Getting Started


For generating seed data

First, you'll need Node.js (opens in a new tab) and postgres (opens in a new tab) installed on your system.

Once you have these, installation should be as simple as running this following in your command line:

>_ terminal

# Set up Snaplet with npx
npx snaplet setup

Snaplet will ask you a few questions to set up snaplet for your project. Along the way, it tries to detect the package manager used for your project and uses this to download the snaplet npm packages needed for your project.

For snapshots

Snaplet can either be self-hosted or accessed as a web app via our cloud service, Snaplet cloud. The choice is yours!

We recommend beginning with Snaplet cloud (opens in a new tab). Sign up for free and start utilizing your data in mere minutes!

For those looking to delve deeper or self-host Snaplet, try our user-friendly snaplet setup CLI wizard!

>_ terminal

# Set up Snaplet with npx
npx snaplet setup

When you run snaplet setup, you will be asked a few questions to complete setup, and generate a snaplet.config.ts configuration file for your project.

Manual setup

Installing dependencies

Snaplet requires the following dependencies to be present in your project:

  • a package.json: to determine where to install snaplet packages to
  • a package manager lockfile to be present for your project - to detect which package manager you are using

If you do not have a package.json, you can add one to your project with:

>_ terminal

npm init -y

We look for a package manager lockfile for npm, pnpm, yarn, or bun. If you do not have a lockfile for your project, or you are using a different package manager, you can still install snaplet npm packages manually:

>_ terminal

npm install --save-dev snaplet @snaplet/seed

Generating @snaplet/seed assets

Once @snaplet/seed has been installed as a dependency, we still need to generate the assets that @snaplet/seed uses - snaplet looks at your database and generates a library that corresponds to your database structure.

If you are familiar with @prisma/client (opens in a new tab), you can think of snaplet generate doing the same thing, just in this case for @snaplet/seed rather than @prisma/client.

This can be done by running:

npx snaplet generate