Framework guides
Use Da8a with Vue and Nuxt
supabase-js runs in any Vue or Nuxt app. Create one client, share it with a composable, and let Row Level Security decide what each user can see.
Before you start
- A Da8a project (the Overview page shows the project URL and anon key)
- A table to query; the quickstart creates a
todostable with Row Level Security
Install the client
$ npm i @supabase/supabase-jsCreate the client
import { createClient } from '@supabase/supabase-js'
const client = createClient(
import.meta.env.VITE_SUPABASE_URL, // Nuxt: useRuntimeConfig().public
import.meta.env.VITE_SUPABASE_ANON_KEY,
)
export const useDb = () => clientThe 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.
Realtime in a component
const db = useDb()
onMounted(() => {
db.channel('todos')
.on('postgres_changes', { event: '*', schema: 'public', table: 'todos' }, load)
.subscribe()
})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
Does it work with Nuxt SSR?
Yes. Create the client from runtimeConfig.public values so it works on server and client.
Related
- React (Vite) with a Supabase-compatible backend
- Next.js with a Supabase-compatible backend
- SvelteKit with a Supabase-compatible backend
- React Native and Expo with a Supabase-compatible backend
- Quickstart
- supabase-js client docs
Updated 2026-10-23.