- What an account stores. Every call needs the repository id (
repository, such asmy-repofrommy-repo.prismic.io), stored on the account or passed asprismic({ repository }). The account’s key is a write token (Settings, API & Security, Write APIs), which only themigration.*operations need. A private repository also needs its Content API access token (access_token, orprismic({ accessToken })); a public one needs nothing for reads. - A query is pinned to a ref. Prismic refuses a document query without one. When
refis omitted, the plugin reads the repository’s master ref first, which is the published content. Pass a release’sreffromrepository.infoto read that release instead. - Paging. A search returns
next_pagewhile another page exists. It already carries the ref and every filter, so pass it asnextPageand the other fields are ignored. For a changing dataset theaftercursor is steadier thanpage. - Predicates.
qtakes a Prismic predicate expression such as[[at(document.type, "page")]], andorderingstakes a sort such as[my.page.date desc]. The plugin passes both through rather than parsing them. - Document bodies are yours. Which fields a document has depends on the repository’s custom types, so
datais read and written as it is sent and Prismic validates it. - Migration writes are drafts.
migration.createandmigration.updatesave into a migration release, which you publish from the Prismic UI or the client library afterwards. Prismic accepts one page per request at one request per second per repository. - An update replaces the content.
migration.updateneeds the fulldata, which replaces what is stored, and omittingtagsdeletes every tag.type,langand the translation link cannot be changed. - Webhooks. Prismic can call a URL when content changes, but this plugin does not handle inbound deliveries.
- 5 typed API operations
Setup
1
Install
2
Add the plugin
corsair.ts
multiTenancy: true, scope calls with corsair.withTenant(id). See Quick start for KEK + Hub keys, and Multi-tenancy for account isolation.3
Choose authentication
- API Key (Recommended)
Store the Prismic API key before the first call: More: API Key
pnpm corsair setup --plugin=prismic --tenant=acme api_key=<your-key> (leave out --tenant without multiTenancy), or pass it as key in the plugin options. With Hub, each tenant enters their own key on the connect page. See API key auth.4
Connect a tenant
Mint a connect link and send the tenant to it. Hub hosts the page and delivers the result to your app — see Connect / OAuth.
Example API calls
Read the first page of documentsWhat’s next
API reference
Every
prismic.api.* operation with input and output types.Connect / OAuth
createLink, Hub delivery, and tenant connect flows.
Use with agents
Expose this plugin’s operations as MCP tools.