C15T Logo

Getting Started

Quick start guide for self-hosting c15t with the @c15t/backend package.

DB Setup + Migrations

Run the Self Host CLI

npx @c15t/cli

Manual Setup

Install @c15t/backend Package

npx @c15t/backend

Create a c15t instance

c15t.ts
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);