Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 1.87 KB

File metadata and controls

19 lines (16 loc) · 1.87 KB

Deployment on Cloudflare Workers

  1. Fork the repository to your GitHub account.

  2. Create a KV namespace (under Storage & Databases -> KV), and copy the namespace ID.

  3. Update the kv_namespaces ID in wrangler.jsonc with your own namespace ID.

  4. Create a project in Cloudflare Workers.

  5. Select the Sink repository and use the following build and deploy commands:

    • Build command: pnpm run build or npm run build
    • Deploy command: npx wrangler deploy
  6. Save and deploy the project.

  7. After deployment, go to Settings -> Variables and Secrets -> Add, and configure the following environment variables:

    • NUXT_SITE_TOKEN: Must be at least 8 characters long. This token grants access to your dashboard.
    • NUXT_CF_ACCOUNT_ID: Find your account ID.
    • NUXT_CF_API_TOKEN: Create a Cloudflare API token with at least Account.Account Analytics permission. See reference.
  8. Enable Analytics Engine. In Workers & Pages, go to Account details in the right panel, locate Analytics Engine, and click Set up to enable the free tier. Name them sink and ANALYTICS, or else overwrite it with NUXT_DATASET and update your wrangler.jsonc accordingly

  9. Redeploy the project.

  10. To update your code, refer to the official GitHub documentation: Syncing a fork branch from the web UI.