Manual setup
Installation
-
First, install the
astro-pocketbase
package:Terminal window npm install astro-pocketbaseTerminal window pnpm add astro-pocketbaseTerminal window yarn add astro-pocketbase -
Most package managers will install associated peer dependencies as well. If you see a
"Cannot find package 'pocketbase'"
(or similar) warning when you start up Astro, you’ll need to installpocketbase
:Terminal window npm install pocketbaseTerminal window pnpm add pocketbaseTerminal window yarn add pocketbase -
Then, apply the integration to your
astro.config.*
file using theintegrations
property:astro.config.mjs import { defineConfig } from "astro/config";import pocketbase from "astro-pocketbase";export default defineConfig({// ...integrations: [pocketbase()],}); -
You also need to provide 3 environment variables for Astro PocketBase to retrieve your collections:
Terminal window # This will only be available when run on the server!ASTRO_POCKETBASE_ADMIN_EMAIL="admin@mydomain.com"ASTRO_POCKETBASE_ADMIN_PASSWORD="mypassword"# This will be available everywhere!PUBLIC_ASTRO_POCKETBASE_URL="https://myproject.pockethost.io"