Introduction#

RafikiDB is a hosted backend for web and mobile apps. Instead of building your own API server, you get:

CapabilityDescription
Data APICRUD over managed PostgreSQL tables with filters, joins, keyset pagination and row-level security
AuthenticationProject users via email/password and phone OTP
RealtimePush table changes to your app over WebSocket or Server-Sent Events, with event recovery
StorageS3-compatible buckets, objects, folders and presigned upload/download URLs
Edge functionsSandboxed JavaScript/TypeScript functions with deploy + invoke
WebhooksOutbound HTTP notifications with HMAC signing and delivery retries
PaymentsM-Pesa STK push and Snippe (mobile money + hosted checkout)
Environment & secretsScoped env vars per environment and encrypted project secrets

How it fits together#

Your app ──> @rafikidb/sdk ──> RafikiDB API ──> PostgreSQL / Redis / the realtime server / S3
                                      │
                                      └──> webhooks / M-Pesa / Snippe / edge functions
Text

The envelope#

Every API response uses the same envelope:

{
  "success": true,
  "message": "Request was successful",
  "data": { }
}
JSON

Errors:

{
  "success": false,
  "message": "Email must be a valid email address",
  "errors": ["Email must be a valid email address"]
}
JSON

What you need#

  1. A project in the dashboard (gives you a project id)
  2. An API key (Access → API Keys)
  3. Optionally a project-user session for row-level security

Continue to the Quickstart.