Getting Started
Quick start guide for self hosting c15t with the @c15t/backend package.
On this page
Canary Feature
This feature is available in canary releases and may have breaking changes. Use with caution in production. Report issues on GitHub
CLI Setup
Generate Schema + Code
npx @c15t/cli generate
Run Database Migrations
npx @c15t/cli migrate
Manual Setup
Install @c15t/backend
Package
npx @c15t/backend
Run Migrations
npx @c15t/cli migrate
Create a c15t instance
import { c15tInstance } from '@c15t/backend/v2';
import { kyselyAdapter } from '@c15t/backend/v2/db/adapters/kysely';
import { Kysely } from 'kysely';
const handler = c15tInstance({
appName: 'example-app',
basePath: '/',
adapter: kyselyAdapter({
db: new Kysely({ }),
provider: 'postgresql',
}),
trustedOrigins: ['localhost', 'vercel.app'],
advanced: {
disableGeoLocation: true,
openapi: {
enabled: true,
},
},
logger: {
level: 'debug',
},
});
const handleRequest = async (request: NextRequest) => handler.handler(request);