Quickstart
Create a project, grab keys, install the SDK, and run your first select.
1. Create a project
- Sign up or sign in
- Create an organization and a project
- Open Database and create a table (e.g.
productswithid,name,price)
2. Get your keys
Open API in the project sidebar. Copy:
- Project URL — looks like
https://api…/api/projects/your-slug - Anon key — safe for browsers (reads + realtime; writes need RLS + user JWT or service role)
- Service role key — full access; server only
Never expose the service role key
Put it only in server environments. Rotate from the API page if it leaks.
3. Install
terminal
npm install voltbase-js4. First query
index.ts
import { createClient } from 'voltbase-js';
const voltbase = createClient(
'https://YOUR_API/api/projects/YOUR_SLUG',
'YOUR_ANON_KEY',
);
const { data, error } = await voltbase
.from('products')
.select('id, name, price')
.order('created_at', 'desc')
.limit(10);
console.log(data, error);5. Write with service role
Inserts/updates/deletes with the anon key alone require an authenticated user JWT (after RLS policies). For server scripts, use the service role:
index.ts
const admin = createClient(projectUrl, 'YOUR_SERVICE_ROLE_KEY');
const { data, error } = await admin.from('products').insert({
name: 'Keyboard',
price: 99,
});Next: pick a framework quickstart, read Auth, or try the Todo + RLS example.