Quick Start: create-centrali-app¶
The fastest way to start building with Centrali. Scaffold a fully configured app in seconds.
Prerequisites¶
- A Centrali account (sign up at centrali.io)
- A publishable key — create one in Console > ACCESS > Publishable Keys
- Node.js 18+
Create Your App¶
You'll be prompted to choose:
- Template: React + Vite or Next.js
- TypeScript: Yes (default) or No
Or skip the prompts with flags:
# React + Vite (TypeScript)
npx @centrali-io/create-centrali-app my-app --template=react-vite
# Next.js (TypeScript)
npx @centrali-io/create-centrali-app my-app --template=nextjs
# JavaScript instead of TypeScript
npx @centrali-io/create-centrali-app my-app --template=react-vite --no-typescript
Configure Environment¶
The fastest way to set up your environment variables:
This detects your template type, prompts for your workspace slug and publishable key, and writes a .env.local file.
Or configure manually — copy .env.example to .env.local and fill in your values:
# Client-side (safe for browser)
NEXT_PUBLIC_CENTRALI_API_URL=https://centrali.io
NEXT_PUBLIC_CENTRALI_WORKSPACE=your-workspace-slug
NEXT_PUBLIC_CENTRALI_PK=pk_live_your_publishable_key
# Server-side (API routes and server components only)
CENTRALI_API_URL=https://centrali.io
CENTRALI_WORKSPACE=your-workspace-slug
CENTRALI_CLIENT_ID=ci_your_client_id
CENTRALI_CLIENT_SECRET=sk_your_client_secret
Where to get credentials
Publishable key: Console > ACCESS > Publishable Keys > Create Key. Select which collections and actions the key can access.
Service account (Next.js server-side): Console > ACCESS > Service Accounts. Create one and add it to the workspace_developers group.
Run¶
Your app will start at http://localhost:5173 (React + Vite) or http://localhost:3000 (Next.js).
What's Included¶
The scaffolded app comes with a working CRUD flow:
- List collections — auto-discovers collections in your workspace
- Create collection — inline form to create your first collection (starts with
nameanddescriptionfields) - View records — click into any collection to see its records
- Create records — form auto-generated from collection properties
Templates¶
React + Vite¶
- React 19 + Vite + TailwindCSS 4
- Client-side app with the Centrali SDK
- Publishable key authentication (safe for browser)
- Single-page with state-based navigation
Next.js¶
- Next.js 15 + TailwindCSS 4
- Server components for data fetching (service account)
- Client components for forms (publishable key)
- API routes for mutations (collections, records)
- File-based routing (
/→ collections list,/collections/[slug]→ records)
Deploy¶
Each template includes a DEPLOY.md with step-by-step instructions for deploying to Vercel and Netlify, including which environment variables to set.
You can also generate platform-specific env var commands:
# Vercel CLI commands
npx @centrali-io/create-centrali-app env --format=vercel
# Netlify CLI commands
npx @centrali-io/create-centrali-app env --format=netlify
Using Your Own Auth Provider¶
The template starts with publishable key authentication for simplicity. Once your app needs user-specific access, you can switch to your own auth provider (Clerk, Auth0, etc.) and pass user tokens instead.
- SDK Authentication Guide — all three auth methods explained
- External Auth (BYOT) — bring your own token
Next Steps¶
- SDK Documentation — full API reference
- Collections — learn about data modeling
- Serverless Functions — add server-side logic
- Search — add full-text search to your app