SDKs and Libraries
Official client libraries for calling the Canopy API, plus the REST and OpenAPI route for every other language.
Official SDKs
Maintained by the Canopy team. They wrap the response envelope, pagination and retries so you do not hand-roll HTTP calls, and they answer token verification and permission checks inside your own process, so neither costs a call to Canopy on every request.
Requires Node 18 or later, and runs unchanged anywhere fetch exists: browsers, Cloudflare Workers, Deno. Ships ESM and CommonJS with generated types and zero runtime dependencies.
A module that registers the client as an injectable provider and a guard that evaluates a permission on a route, so authorization is a decorator rather than a call in every handler. Three scopes: node, app_wide, and org, which decides inside the organization the caller's token is acting in. Requires NestJS 10 or 11.
What the SDKs handle for you
Writing a fetch call against a documented REST API is straightforward. These are the parts that are easy to get subtly wrong, and they are why the hand-written layer exists.
No SDK for your language?
Every Canopy capability is available over plain HTTP. The API is described by an OpenAPI specification published at a stable URL, so you can generate a typed client for any language your toolchain supports, or call the endpoints directly.
Feed this document to a generator and get a typed client in the language you build in. It is the same specification that renders Canopy's own API reference, so it never drifts from the live API.
Or skip the generator. Every endpoint is a plain HTTP call.
curl -X POST https://auth.canopy-io.com/api/v1/permissions/evaluate \
-H "X-API-Key: $CANOPY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"identity_id": "idn_8f2c",
"permission": "orders.refund",
"scope": "node",
"node_id": "nod_sf01"
}'Always send a scope
scope is required. Use node to ask whether the identity holds the permission at node_id, walking the lineage so a grant on an ancestor is inherited. Use app_wide for the coarse “anywhere in this Environment” question: useful for hiding a menu item, never for guarding a resource that belongs to a node.
Versioning
The SDK follows semantic versioning. While it is on a 0.x release the surface may still change between minor versions, so pin the minor if you need that stability. The generated types are checked against the published specification on every build, so a release cannot quietly describe an API that has moved on.
Tell us how we can improve this guide.