CLI — create-paperdb
create-paperdb scaffolds a new project with the PaperDB SDK pre-configured. It prompts you for a framework, auth providers, and features, then generates a ready-to-run project.
Quickstart
npx create-paperdb@latestOr pass a project name directly to skip the first prompt:
npx create-paperdb@latest my-appWhat it generates
The CLI walks you through four choices and then writes the project:
- Framework — React / Next.js, Vue / Nuxt, Svelte / SvelteKit, or Vanilla JS (CDN)
- Auth providers — Email/password (always included), Google OAuth, GitHub OAuth, Apple OAuth, Magic Link
- Features — Realtime, Webhooks, Cron Jobs, File Storage, Full-Text Search, Offline Sync
The generated project includes:
src/db/schema.ts— example schema withusersandpostscollectionssrc/db/index.ts— typed PaperDB clientpaperdb.config.ts— feature flags and auth config.env.example— all required environment variables- Framework entry point and a working example component
After scaffolding
cd my-app
npm install
cp .env.example .env
# Add your PAPERDB_API_KEY to .env
npm run devGet your API key from the Dashboard → Databases → API Keys page after creating a database.
Manual setup
If you prefer to add PaperDB to an existing project:
npm install paperdbimport { createClient } from "paperdb";
const db = createClient({
apiKey: process.env.PAPERDB_API_KEY,
});