Docs

Move a custom backend to Sovaria

Replace parts of your own API server with Sovaria step by step: which endpoints become direct data access, functions or stay on your server; auth, files, realtime, jobs and webhooks; and a checklist for each move.

Updated Oct 17, 2026

You don't have to move everything at once. Run your server and Sovaria side by side and move one piece at a time; your server can verify Sovaria sessions and call Sovaria while it shrinks.

Where each part goes

In your backendIn SovariaRead
DatabaseYour project's PostgresMigrate from PostgreSQL
CRUD endpoints that only check "is this the owner?"The app reads and writes directly with the SDK; row-level security and access policies do the checksHow access is decided
Endpoints with business logic (payments, emails, calls to other APIs)Functions, called over HTTPS or from the SDKDeploying and running functions
Sign-up, sign-in, sessionsSovaria Auth; your server verifies tokens with the project's JWKSSessions and tokens
File uploadsStorage buckets with per-folder rules and signed URLsWorking with files
WebSockets or pollingRealtime channels and database change eventsChannels and connections
Cron jobs, queues, outgoing webhooksFunction schedules and triggers, database webhooksEvent triggers, Database webhooks
Staging and preview serversEnvironments with their own URL and dataEnvironments, staging and deploying to production

Run both side by side

  • Move sign-in first: once users have Sovaria sessions, your server checks their tokens (ES256, keys from /auth/v1/.well-known/jwks.json) instead of its own.
  • Your server can act as the user (forward their token, so Sovaria's rules apply) or as itself with a service role key — then it must check permissions itself (JavaScript: React, Next.js, Vite and Node, Python: install and configure).
  • Move endpoints one at a time: make the app call Sovaria for that feature, watch the logs, then delete the endpoint.

Files

Copy existing files with the S3-compatible API — aws s3 cp --recursive or rclone work against it (S3-compatible storage access) — or sov storage upload for a few. Keep the same paths, with the user's id as the first folder where files belong to a user, so own-folder rules apply (Access, links and delivery).

Checklist for each piece you move

  • Rules written and checked: sov rules test cases for who may and may not (Access rules tests), and a simulation run.
  • Secrets moved into function secrets, never into app code.
  • Errors handled in the app: SovariaError codes (JavaScript: install and configure).
  • Tested against staging with test users (Testing your app).
  • Old endpoint kept until traffic to it stops, then removed.

Things that work differently

Something unclear or missing on this page?Tell us