App Recipes
Recipes for the backend an app needs: data, files, email, auth and shipping to a URL. Recursiv gives you all of it from one SDK, so you never wire up separate services. Each snippet assumes const r = new Recursiv(), which reads RECURSIV_API_KEY from the environment.
Provision a database
Call ensure on every deploy. It creates the Postgres database the first time and returns the existing one after that, so it is safe to run repeatedly.
Query the database
Run SQL straight against a project’s database and read the rows back.
Upload a file
Storage uploads are two steps: get a presigned URL, then PUT the bytes directly to it. ensureBucket is idempotent.
Share a file with a download link
Generate a presigned download URL to hand to a browser or client.
Send an email
Send a transactional email. With a BYOK Resend key on the org, it sends from your own domain.
Add email and password auth
Sign a user up and mint an API key for them in one call. Ideal for mobile, where cookies do not persist. Bind the key to the project so users become app members.
Add passwordless (OTP) auth
Email a one-time code, then verify it to sign in. Auto-creates the user if they are new.
Scaffold a new app from a template
Create a deployable Next.js or Expo repo server-side. No local gh, git or GitHub account required.
Deploy to a live URL
Link a repo to a project, then deploy. The deployment URL is returned once it is live.
Tail deployment logs
Read build and runtime logs for a deployment to debug a failed ship.