### Run Development Server Source: https://github.com/000alen/better-auth-pocketbase/blob/main/examples/next/README.md Commands to start the Next.js development server using different package managers. This allows for local testing and development. ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` -------------------------------- ### Client-side Setup with PocketBase Adapter Source: https://github.com/000alen/better-auth-pocketbase/blob/main/README.md Shows how to set up the better-auth client for PocketBase on the client-side, including base URL and plugin integration. ```ts import { createAuthClient } from "better-auth/react" import { usernameClient, organizationClient, apiKeyClient } from "better-auth/client/plugins" export const authClient = createAuthClient({ baseURL: "http://localhost:3000", plugins: [ usernameClient(), organizationClient(), apiKeyClient(), ] }); ``` -------------------------------- ### Server-side Setup with PocketBase Adapter Source: https://github.com/000alen/better-auth-pocketbase/blob/main/README.md Configures the PocketBase adapter for better-auth on the server. It specifies the PocketBase URL, collection prefix for migrations, and optional admin credentials for generating PocketBase schema migrations. ```ts import { betterAuth } from "better-auth"; import { username, organization, apiKey } from "better-auth/plugins"; import { pocketbaseAdapter } from "better-auth-pocketbase"; const adapter = pocketbaseAdapter({ url: "http://127.0.0.1:8090", collectionPrefix: "ba_", // All collections will be prefixed with this // Optional: Generate PocketBase migrations generateMigration: true, // Admin credentials for migration generation authToken: { email: process.env.POCKETBASE_EMAIL!, password: process.env.POCKETBASE_PASSWORD!, } }) export const auth = betterAuth({ database: adapter, emailAndPassword: { enabled: true, }, plugins: [ username(), organization(), apiKey(), ], }) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.