Blocks
Blocks are production features you add with one command. Like shadcn/ui components, they are copied into your project as source code: you read them, own them and change them. There is no runtime package to keep up with.
npx calm add jobs Blocks
+ @calmapi/jobs v1.0.0 · @calmapi (bundled)
Background jobs and cron on MongoDB (no Redis): retries with backoff, schedules, event triggers, admin API and a devtools panel.
Files
create app/blocks/jobs/cron.js
create app/blocks/jobs/index.js
create app/blocks/jobs/queue.js
create app/jobs/welcome-email.js
Environment (.env.example and .env)
+ JOBS_WORKER=on
+ JOBS_CONCURRENCY=4
? Apply these changes? [Y/n]calm add writes the files, adds npm dependencies to package.json and installs them, appends environment variables to .env.example and .env (without touching values you already have), records the block in calm.lock, and prints the block's notes. Restart (or let npm run dev restart) and the block is live: every folder in app/blocks/ with an index.js is loaded at boot.
Official blocks#
There are 35, each with its own page here and its own guide in the project after you add it (below).
35 official blocks
Users and access
api-keysv1.0.0Personal and service API keys with scopes for scripts and integrations: shown once, hashed at rest, expiry and revoke.
no deps4 files
captchav1.0.0Cloudflare Turnstile, hCaptcha or reCAPTCHA v3 on sign-up, sign-in and password reset, failing closed.
no deps2 files2 env vars
email-verificationv1.0.0Verification links after sign-up and email changes, a verified policy, and required verification for routes or sign-in.
no deps2 files
magic-linkv1.0.0Passwordless sign-in by email: single use links, a cooldown per address, a redirect allowlist and links bound to the browser that asked.
no deps2 files
oauthv1.0.0Sign in with Google, GitHub and OpenID Connect
OAuth and OpenID Connect sign-in with PKCE, verified ID tokens and safe account linking.
no deps4 files4 env vars
privacyv1.0.0Users download everything they own and delete their account; per resource delete, anonymize or keep, with admin routes and a grace period.
no deps4 files
teamsv1.0.0Organizations, roles, invitations and team-scoped resources with strict isolation.
no deps5 files
totpv1.0.1Authenticator-app codes on login, with single-use recovery codes, replay protection and secrets encrypted at rest.
no deps3 files1 env var
Messaging
mail-postmarkv1.0.0Deliver email through Postmark with tags, message streams and attachments.
no deps2 files3 env vars
mail-resendv1.0.1Deliver password resets and notifications through the Resend HTTP API.
no deps2 files2 env vars
mail-smtpv1.0.1Deliver email through any SMTP server with Nodemailer.
nodemailer2 files2 env vars
notificationsv1.0.0Notifications: inbox, push and email
One call writes the in-app inbox, sends a push and an email, following each user's preferences and quiet hours.
no deps5 files
push-expov1.0.0Deliver push notifications to Expo and React Native apps through the Expo push service.
no deps2 files1 env var
push-fcmv1.0.0Push notifications via Firebase Cloud Messaging
Deliver push notifications to Android, iOS and web through Firebase Cloud Messaging HTTP v1, no SDK.
no deps2 files1 env var
realtime-ssev1.1.0Live resource events over Server-Sent Events, filtered per subscriber by your policies.
no deps2 files
slackv1.0.0App events and security alerts to Slack, with escaped templates, digests and retries.
no deps2 files3 env vars
sms-twiliov1.0.0SMS and phone verification with Twilio
An SMS transport and phone verification with hashed one-time codes and signed status callbacks.
no deps3 files4 env vars
webhooksv1.0.1Outgoing webhooks for resource events: signed, queued, retried and logged, filtered by what each subscriber may read, SSRF safe.
no deps5 files1 env var
Data and files
audit-logv1.0.1Who changed what and when, with field-level diffs that never record private values.
no deps2 files1 env var
exportv1.0.0Streamed CSV, NDJSON or JSON exports that respect field visibility, and validated imports with dry runs.
no deps3 files
search-meilisearchv1.0.0Full-text search kept in sync with your resources, filtered by your policies.
no deps3 files3 env vars
soft-deletev1.0.0Opt-in soft delete per resource, with trash and restore for admins.
no deps2 files
storage-localv1.0.1File uploads to local disk with type and size allowlists, magic-byte checks and safe downloads.
multer6 files3 env vars
storage-s3v1.0.1Direct-to-S3 uploads with presigned URLs for AWS S3, Cloudflare R2 and MinIO.
@aws-sdk/client-s3, @aws-sdk/s3-request-presigner6 files7 env vars
Running in production
cachev1.0.0GET responses cached per identity in MongoDB or memory, invalidated by resource events, with ETag and 304.
no deps3 files
feature-flagsv1.0.0Kill switches, gradual rollouts, per user and per role targeting, weighted variants and route gates, stored in MongoDB.
no deps4 files
idempotencyv1.0.0Safe retries for writes: the Idempotency-Key header replays the stored response instead of running an operation twice.
no deps2 files
jobsv1.0.1A MongoDB job queue and cron: retries, schedules, event triggers and an admin API. No Redis.
no deps5 files2 env vars
maintenancev1.0.0Maintenance and read-only modes at runtime or on a schedule, with allowlists and Retry-After.
no deps2 files1 env var
rate-limit-mongov1.0.0Keep rate limit counters in MongoDB so limits hold across instances.
no deps2 files
sentryv1.0.05xx and background errors to Sentry without the SDK, with secrets scrubbed, sampling and deduplication.
no deps3 files3 env vars
Payments and growth
payments-stripev1.0.0Stripe Checkout, subscriptions and the customer portal without the SDK, verified webhooks and plan-gated routes.
no deps4 files2 env vars
waitlistv1.0.0A launch waitlist with referral codes, admin invites and invite-only registration.
no deps2 files
APIs and agents
api-docsv1.0.1An interactive API reference at /docs, rendered from your OpenAPI document.
no deps2 files1 env var
mcp-serverv1.0.1Expose your resources to AI agents as MCP tools, enforced by your API rules.
no deps2 files1 env var
npx calm add --list # official blocks
npx calm add jobs audit-log # several at once
npx calm add jobs --dry-run # show the plan, write nothing
npx calm block list # blocks in this project, and the files you changedThe devtools Blocks panel shows every installed block: where it came from, the files you changed since, what it hooks into, its environment variables (set or missing), its routes, links to the official documentation of what it integrates, and its instructions for AI agents.
Each block brings its own guide#
Every block is added with an app/blocks/<name>/AGENTS.md next to its code: the rules it must keep, its options, common tasks, and links to the official documentation of the service it integrates (Stripe, Twilio, Slack, OpenID Connect, OWASP...). The project's AGENTS.md tells coding agents to read it before they change the block, so they follow the provider's documentation rather than memory. It comes from the links and agents fields of the block's block.json; see Agents and links.
Where blocks come from#
An address is resolved like this:
| Address | Source |
|---|---|
jobs or @calmapi/jobs | The official registry. The CLI carries a copy of it, so this works offline. --remote fetches https://docs.calmapi.dev/r/jobs.json instead. |
gh:acme/blocks/billing | r/billing.json in a GitHub repository, what calm block pack writes. Add @v1.2.0 (or a branch or commit) to pin it. |
@acme/billing | The @acme registry declared in your package.json |
https://example.com/r/thing.json | Any URL |
./blocks/thing.json | A local file |
Registries are declared in package.json:
{
"calm": {
"registries": { "@acme": "https://acme.dev/r/{name}.json" }
}
}The official registry is served as JSON at https://docs.calmapi.dev/r/index.json, one file per block (for example /r/jobs.json), in the shadcn registry-item format. To write and share your own, see Building your own block and Publishing your own block.
Safety rules#
- A block can only write inside your project, never to
calm/orcalm.lock. - Existing files with different content are kept and reported as conflicts; pass
--overwriteto replace them. - Blocks that provide the same resource refuse to be installed together (
storage-localandstorage-s3both providefile). registryDependenciesare installed first; dependencies already inpackage.jsonare left as they are.- Blocks can declare the oldest CalmAPI they work with (
minVersion); older projects are asked to runcalm upgradefirst. - Blocks that are not official are reviewed before anything is written:
calm addlists in plain language what their code does (network requests, file writes, child processes,eval, request hooks, the environment variables it reads, the hosts it mentions). Risky findings must be confirmed, and with--yesthey also need--trust. A block runs in your app with full access, like any code you paste, so read it. See What people see before installing.
After adding a block#
The block's code is now in your project, and it is yours. Change it, delete parts you do not need, or remove the block by deleting its folder (and its entry in calm.lock). Re-running calm add <block> later shows which files differ from the current upstream version. calm upgrade never touches block files.