Welcome to Foir
Foir is the backend your applications run on. Instead of assembling and securing a separate database, authentication service, file store, email sender, billing integration, and background-job runner — and keeping them wired together — you get them as one platform, with every project’s data isolated in the database by default.
One Foir account can back many apps at once. Each project — a site, a store, a client build — is its own isolated space with its own content, users, API keys, and domains, so an agency or team can run a whole portfolio of apps from a single backend.
Quick Links
- Getting Started — Set up your first project
- Auth for your app — Use Foir as your authentication layer, no CMS required
- Features — Everything the platform gives you
- Authorization & Access — How data isolation works, and why you can’t misconfigure it
- API Reference — GraphQL API, authentication, files, webhooks
- Config System — Define your project as code with
foir.config.ts - CLI Reference — Manage your project from the terminal
What you get
A database with a typed API
Model your data with Models and field types — text, rich text, images, references, and more — and read and write it through an auto-generated GraphQL API. Records back anything: content pages, product catalogs, bookings, form submissions, per-user data. Versioning, drafts, and scheduled publishing are built in per model.
Authentication for your users
Sign your end users in with Customer Authentication — email/password, one-time codes, and OAuth providers — or hand the whole flow to Login with Foir, hosted on your own custom domain. Customers get durable accounts you manage from the admin; you get short-lived tokens to authorize their requests. See Customers. Using Foir just for auth? Start with the Auth for your app track.
Authorization that can’t leak
Access rules are enforced in the database itself, so a request can only ever reach the project — and the rows — it’s allowed to. Tenancy isolation, per-record visibility, ownership, and sharing are all evaluated below your code, not inside it. See Authorization & Access.
File and media storage
Upload images, video, audio, and documents with Media & Files. Serve transformed images on the fly, stream video, and gate private files behind signed access — no separate object store to provision.
Email, billing, and background work
Send transactional email, meter usage and take payments through built-in Billing, and run work off the request path with Operations, Lifecycle Hooks, and cron Schedules on a durable queue with retries. Receive events at your own endpoints — see Webhooks.
Search
Query by keyword or by meaning. Semantic search generates vector embeddings for your content, so “winter clothing” also finds “cold-weather apparel.”
Personalization
Serve different content to different audiences with Variants, targeted by device, market, language, or customer segments using targeting rules.
Extend it
Define your models, operations, hooks, and editor placements in a foir.config.ts file and push them with one command. Build custom admin UIs with the Editor SDK, and install first- or third-party Apps — Shopify, Stripe, translation, image transforms — by manifest URL.
Capabilities at a glance
| Area | What it gives you |
|---|---|
| Data | Typed models and records, versioning, drafts, scheduled publishing |
| API | Auto-generated GraphQL, scoped API keys, response caching |
| Auth | Customer accounts, OAuth, one-time codes, hosted login on custom domains |
| Authorization | Database-enforced project isolation, per-record visibility, sharing grants |
| Storage | Image/video/file uploads, on-the-fly image transforms, signed private files |
| Email & billing | Transactional email, Stripe-backed billing and usage metering |
| Automation | Operations, lifecycle hooks, cron schedules, webhooks, durable retries |
| Search | Full-text and semantic (vector) search |
| Personalization | Variants, targeting, and customer segments |
| Localization | Multi-language content with fallback chains |
| Collaboration | Notes, comments, @mentions, and a per-user notification inbox |
| Extensibility | Config-as-code, CLI, Editor SDK, installable Apps |
Getting Started
- Create an API Key — Connect your application to Foir
- Install the CLI — Get the platform CLI with
npm install -g @foir/cli - Fetch Content — Query the GraphQL API from your frontend
- Define as Code — Set up
foir.config.tsfor your project