Logo VelaStack

Enable Backend

Enable the PocketBase backend for your SvelteKit app. This will create a data directory in your project with the PocketBase server files.

$ vela enable backend
data/fixtures/README.md
Sample data for development
data/hooks/README.md
# Hooks

Add \*.pb.js hooks here to extend PocketBase: https://pocketbase.io/docs/js-overview/
data/seeds/README.md
Essential system-level data (e.g., roles, locales)
src/hooks.server.ts
import { env } from "$env/dynamic/private";
import { handlePocketbase } from "@velastack/pocketbase";

export const handle = handlePocketbase({
  pocketbaseUrl: env.POCKETBASE_URL,
  superuserEmail: env.POCKETBASE_SUPERUSER_EMAIL,
  superuserPassword: env.POCKETBASE_SUPERUSER_PASSWORD,
});