Also available: Markdown version · llms.txt · full site content
Getting started
How CubiBase works
Two HTTP surfaces, one database per project. The Console manages the project through the control API; your application calls the project host.
The two surfaces
Developer
Console
tables · rows · SQL · keys
Control plane
Control API
projects · schema · auth settings
Application
Your app
apikey + user JWT
example-project.api.cubibase.com
Project host
/rest/v1 · /auth/v1 · /storage/v1 · /functions
One project
example_project_db
public · auth · storage · logs
| Surface | Who calls it | What it does |
|---|---|---|
| Control API | The Console (your developer session) | Accounts, projects, tables, rows, SQL, API keys, auth settings, usage |
Data API · /rest/v1 | Your application | Reads and writes on the tables you expose |
Auth API · /auth/v1 | Your application | Sign-up, sign-in, sessions, Google, MFA |
The project host
Every project gets a host of the form https://{slug}.api.cubibase.com. The engine resolves the project from the trusted Host header — it never consults X-Forwarded-Host — and validates the publishable key against that project.
| Piece | Value |
|---|---|
| Slug | example-project |
| API host | https://example-project.api.cubibase.com |
| Database | example_project_db |
| Data API base | /rest/v1 |
| Auth API base | /auth/v1 |
What provisioning creates
Provisioning creates one PostgreSQL database and four login roles, all NOSUPERUSER and NOBYPASSRLS:
| Role | Used by | Purpose |
|---|---|---|
ddl | Schema API | Creates and alters tables |
api | Data API | Serves exposed tables, limited by grants and row policies |
sql | Console | Row browser and the read-only SQL editor |
auth | Auth API | Sign-up, sign-in, and sessions against the auth schema |
Alongside public, where your tables live, the database has managed schemas: auth (users, sessions, factors, identities), logs (request and auth events), vault (project secrets no request role can read), and storage (the bucket and object catalog, upload sessions, and object events for S3-backed file storage). Developer accounts live separately, in the platform metadata database.
How a request is authorized
- The
Hostheader selects the project; theapikeyheader must be an active publishable key for it. - The bearer JWT is verified (HS256 for CubiBase Auth, or RS256 against your IdP’s JWKS). Its
subclaim is the user id. - For session-bearing tokens, the engine checks the session is still live and the user is not banned.
- The query runs as the API role with
cubibase.user_idset to that subject, so row policies apply to every statement.