Tulip Logo IconTulip
Auth

Better Auth Setup

Configure Better Auth directly while using Tulip's auth helpers for app integration.

Tulip auth starts with Better Auth.

Apps create the Better Auth instance directly, choose plugins directly, and own auth schema and migrations.

Typical setup

import { passkey } from "@better-auth/passkey";
import { authAdditionalFields } from "@tulip-systems/auth";
import { authCookiePrefix } from "@tulip-systems/auth/next/server";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { betterAuth } from "better-auth/minimal";

export const auth = betterAuth({
  advanced: {
    cookiePrefix: authCookiePrefix,
    database: { generateId: () => false as const },
  },
  database: drizzleAdapter(db, { provider: "pg", usePlural: true }),
  plugins: [passkey()],
});

Continue reading

On this page