Skip to content

Primitive ​

Primitive is a backend platform designed to take you from idea to production app as fast as possible — and to work hand-in-hand with AI coding tools along the way. Not demo apps or toys: real applications with authentication, synced data, file storage, access control, LLM-powered automation, and analytics.

You focus on your UI and business logic. Primitive provides everything behind it — no APIs to build, no servers to manage.

From Idea to Production ​

A Primitive app's whole lifecycle fits in a handful of commands:

  1. Scaffold — one command gives you a running app, web or iOS, with sign-in, synced data, and dev tools already wired up.
  2. Add your data — local-first documents with real-time sync, sharing, and access control built in, and no backend code to write; server-side databases for shared records, read and written from your server functions.
  3. Add backend behavior — server functions, managed prompts, and API integrations, all configured as code that lives in your repo.
  4. Ship — the web template deploys with one command; the iOS template ships through TestFlight and the App Store.

The Quick Start walks through it, or see Primitive in action in the Example Apps.

Why Primitive? ​

Real-time, collaborative data is the default, not an add-on. Documents are local-first: your app reads and writes a local store for instant interactions, and changes sync automatically across devices and collaborators with conflict-free merging. Alongside them, server-side databases give you fine-grained access control and server-enforced rules. Most platforms make you choose — or bolt sync on later. Primitive gives you both, designed to work together.

One backend, every platform. Web and iOS are first-class citizens with matching client libraries, matching templates, and one shared data schema. Concepts carry over directly — learn documents, databases, and sharing once, then build for whichever platform your users are on.

Built for AI-assisted development. Tools like Claude and Cursor excel at UI and business logic but struggle with infrastructure plumbing. Primitive's entire backend is operated through the CLI as version-controlled configuration in your repo — exactly the interface coding agents are good at. Agent guides ship with every template, the CLI serves reference docs to your assistant on demand, and a Claude Code skill teaches it platform best practices. Your agent can configure auth, write server functions, and wire up integrations without you touching a dashboard.

One platform, not ten services. Auth, data sync, file storage, server-side functions, integrations, analytics — integrated, consistent, and configured in one place. No dashboard hopping, no credential juggling, no glue code between providers. Every service is built for real workloads: real-time collaboration, fine-grained access control, server-side automation.

What Primitive Provides ​

Authentication ​

Multiple sign-in methods out of the box — Google OAuth, passwordless email sign-in (one email carrying a code and, where your app supports it, a link), and Passkeys (biometric sign-in). Token management, session handling, and refresh are all handled for you.

Data Storage ​

Primitive offers two complementary storage systems:

  • Documents — Local-first, real-time collaborative data. Your app reads and writes a local database on the device; changes sync automatically across devices and users. Great for user-owned data and real-time collaboration.

  • Databases — Server-side structured storage. Read and write records from a server function, with fine-grained access control on the function itself. Great for shared records, cross-user data, admin-controlled content, and server-enforced business rules.

Most apps use one or both — see Choosing Your Data Model for guidance.

Users and Groups ​

Every user gets a built-in profile (name, email, avatar) managed by the platform. Groups let you organize users into teams, roles, or any relationship, and expression-based access rules build on them: who may call each of your server functions, and who may manage groups, collections, blob buckets, database types, and locks.

Server Functions ​

Server-side logic you write in TypeScript and keep in your repo. Call a function from your app and get its result back, or start it as a task that runs to completion in the background; an outside service's webhook or a schedule can fire one too. A function reads and writes your databases, runs your prompts, calls your integrations, and pushes live updates to connected users — and it decides who may call it.

Managed Prompts ​

Version-controlled LLM prompt templates with built-in testing. Define prompt configurations, test them against expected outputs, and run them from your server functions.

Integrations ​

Call external APIs from your server functions. Primitive stores your API keys server-side and adds them to each request, so credentials never ship in your app.

Blob Storage ​

Upload, download, and manage files (images, PDFs, attachments). Document-scoped blobs inherit document permissions; general-purpose blob buckets add TTL tiers, signed URLs, and expression-based access rules for storage that lives outside a specific document.

Sharing and Access ​

Share documents with other users — by user ID, by email (resolves at signup), or with an entire group. Document access requests let users with a link ask for access Google-Docs-style. Member invitations with quotas let regular members bring teammates in without admin involvement.

Analytics ​

Automatic lifecycle event tracking (daily active users, session activity, feature usage) plus custom event logging. Read metrics back from the Admin Console, the CLI, or a server function.

How It Fits Together ​

Your app runs on the user's device — in the browser or on an iPhone — and talks to the platform through a client library that exposes the same features in JavaScript (any framework) and Swift. Optional starter templates for web (Vue) and iOS (SwiftUI) wrap the client with login UI, data-binding helpers, and dev tooling — the fastest start, covered in the Quick Start.

The Primitive Platform itself is a managed service. You operate your app's backend through the CLI — as version-controlled configuration that lives in your repo, and the interface AI coding agents use — or interactively through the web Admin Console. You never touch the underlying infrastructure.

Next Steps ​

Documentation validated against js-bao-wss-client 3.4.0 · js-bao 0.11.0 · primitive-admin 1.0.62 · primitive-app 3.1.0 — 2026-09-30