Skip to content

Manual setup

Installation

  1. First, install the astro-pocketbase package:

    Terminal window
    npm install astro-pocketbase
  2. 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 install pocketbase:

    Terminal window
    npm install pocketbase
  3. Then, apply the integration to your astro.config.* file using the integrations property:

    astro.config.mjs
    import { defineConfig } from "astro/config";
    import pocketbase from "astro-pocketbase";
    export default defineConfig({
    // ...
    integrations: [pocketbase()],
    });
  4. 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"