Framework guides

Use Da8a with Node.js

Use Da8a from Node scripts, workers and APIs, either through supabase-js or a plain Postgres driver, since it’s real Postgres.

Before you start

  • A Da8a project (the Overview page shows the project URL and anon key)
  • A table to query; the quickstart creates a todos table with Row Level Security

Install the client

shell
$ npm i @supabase/supabase-js

Create the client

db.mjs
import { createClient } from '@supabase/supabase-js'
// Server only: the service key bypasses Row Level Security
export const admin = createClient(process.env.PROJECT_URL, process.env.SERVICE_KEY)

The anon key is safe in client code as long as Row Level Security is on for your tables. Never ship the service key to the browser: it bypasses RLS.

Or connect with a Postgres driver

For bulk jobs and reporting, connect directly with pg, Prisma or Drizzle using your project’s database connection string.

Host it

Deploy the frontend on Chapong and link it to the project: the URL, anon key and auth redirect URLs are kept in sync for you, including on preview deploys.

Questions

Should a backend use the anon key or the service key?

The service key, kept in a server secret, when the job needs full access. Use the anon key plus a user’s token when acting on that user’s behalf.

Updated 2026-10-23.