Mount the API
The rolebook-mount-api agent skill.
Mounts the Rolebook Sharing HTTP API in a Hono or Next.js app with @rolebook/server, taking the tenant and actor from the session, checking origins, and keeping invitation tokens on the server, then calls it from the browser with a typed fetch client. Use when the user wants sharing over HTTP, a sharing API for a single-page or mobile frontend, CSRF or CORS settings for that API, or a typed client for share, list, access, and history calls.
Skill name: rolebook-mount-api. Ask your agent for the task in your own words, or invoke the skill by name where your tool supports it.
Packages it needs
| Requirement | Package and supported versions |
|---|---|
| Always | rolebook >=4.0.0 <5.0.0 |
| Always | @rolebook/sharing >=0.1.0 <0.2.0 |
| Always | @rolebook/server >=0.1.0 <0.2.0 |
| One of | @rolebook/sharing-postgres >=0.1.0 <0.2.0, @rolebook/sharing-sqlite >=0.1.0 <0.2.0 |
| One of | @rolebook/sharing-better-auth >=0.1.0 <0.2.0, @rolebook/sharing-clerk >=0.1.0 <0.2.0, @rolebook/sharing-workos >=0.1.0 <0.2.0 |
The skill checks the installed versions against these ranges before it uses each part, and stops rather than up- or downgrading without your consent.
What it does
- Before you start
- Check the starting point
- Agree the model with the user
- Write the context and the API’s sharing
- Mount it
- Call it from the browser
- Other languages
- Test it
- Check your work
Reference files
The skill loads these files from its references/ folder when a step needs them:
client.mdhandler.mdhono.mdnextjs.mdsecurity-rules.mdsharing-module.md