Extensions are small TypeScript programs that run inside Prosaic when something happens — a journal gets posted, a bank transaction is reconciled, IRD accepts a GST return, the clock strikes nine, or someone clicks a button. You write the code and declare what it's allowed to do, and Prosaic hosts and runs it in a sandbox next to the accounting data.
Think of them as the hook system every accountant has asked for, without the spreadsheet macros.
Start here
Create an extension
For developers, and for anyone working with a coding agent.
- Quickstart — install the CLI, scaffold a project, deploy it and watch it run, in about five minutes.
- Manifest reference — the name, scopes, triggers and connections in
prosaic.extension.toml. - Sandbox API — everything on the
prosaicglobal your code calls. - Triggers — events, cron schedules and action buttons, with a handler for each.
- Testing and deploy —
validate, thedevloop,logs, and how versions and permissions change. - Examples — complete extensions to copy.
- Build with an LLM — have Claude, Cursor or ChatGPT scaffold and validate one through the developer MCP server.
Use an extension
For the workspace admins, advisors and accountants it runs for.
- Using extensions — install it on a client's entity, connect its credentials, run its actions, read its runs, and pause, approve, update or remove it.
Extension or API?
Both reach the same ledger. Pick by where the work starts.
- Use the API when your product is the source of the data. It creates entities, posts journals, imports bank transactions and reads reports back into your app. Your server calls Prosaic.
- Write an extension when the work belongs inside Prosaic: reacting to what accountants do in the books, running on a schedule for each client, or adding a button to the app. Prosaic calls your code, and there's no server of yours to run.
When to build one
Good fits:
- Notifications — email a client when their GST return is filed, or post to Slack when a large transaction is reconciled.
- Reminders and chasers — ask clients for documents when a new GST period starts, and handle their replies.
- Scheduled reports — generate last month's profit and loss on the 1st and email it.
- Integrations — push data to another system's API through a connection you declare, with Prosaic holding the credential.
- Workflow helpers — add an action to the transaction list that runs whatever you want, such as AI account suggestions.
Not a great fit:
- Writing to the ledger. Extensions read journals but can't create, edit or void them, or reconcile a transaction. Post journals from your own server with the public API.
- Arbitrary network access or runtime dependencies. Outbound HTTP goes only to hosts you declare, and your code is bundled before it's deployed.
- Long-running work (over 10 seconds, or 2 minutes with
use:ai). Break it up over a cron. - UI beyond an action. An action is a menu item or a button with your label on it; there are no custom screens.
- Distribution. An extension runs in the workspace it was deployed to. There's no marketplace for publishing it to other workspaces.
How it works
trigger fires → installation matches → runtime executes → run recorded
(event, cron, (entity, switched on, (V8 isolate)
action, reply) grant still covers it) ▲ │
│ ▼
prosaic.* bridge API
Each extension has:
- A manifest (
prosaic.extension.toml) that declares its triggers, scopes, connections and metadata. - An entry point (
src/index.ts) — the code that runs on each trigger. - An installation per entity — each client or business is switched on separately, and each installation records the scopes and hosts it was granted.
When a trigger fires, Prosaic queues a job. The runtime starts a V8 isolate, injects the prosaic.* global, runs your code, and records the run — logs, input, output, errors — so you can debug it later. Every call through the global is checked against the scopes in your manifest and the grant on the installation.
What you get inside the sandbox
The prosaic global gives you:
context— what triggered this run, and which entity it's fortransactions— list and read bank transactions, and change a transaction's descriptionjournals,entities— read-onlyreports— profit and loss, balance sheet, trial balance and the other financial reportsgst— GST returns: status, periods and IRD box amountsemail.send— send from a Prosaic-managed address; replies come back to your extensionai.complete— call a large language model through Prosaic's account, no API key of your ownhttp.fetch— call a third-party API you declared, with Prosaic attaching the credentiallinks— remember which record in another system matches which Prosaic recordstorage— a small key-value store for the extensiontools— Prosaic's tool registry, including the chart of accountslog— structured logs you read withprosaic extension logs
No global fetch. No require. No filesystem. No process environment. Anything that leaves the sandbox goes through one of the bridges above, which is what makes it safe to install one extension on many clients' entities.
The full surface, with examples, is in the Sandbox API.
Questions? We read every message at support@prosaic.works.
