Feature SDKs

Official SDKs for Node.js, NestJS and the browser

Typed clients that handle the parts that are easy to get wrong, and answer token and permission checks inside your own process.

Three official packages Zero runtime dependencies in the Node client In-process checks
Packages

Three packages, one way of working

Pick the one that matches where your code runs.

@canopy-io/node

A typed API client, token verifier and local authorizer. Requires Node 18 or later, and runs anywhere fetch exists.

@canopy-io/nestjs

A module and guards, so authorization is a decorator rather than a call in every handler.

@canopy-io/browser

Signs a single-page app with no backend in through Hosted Login, with tokens kept in memory.

Fast checks

Answer in your process, not over the network

Tokens are verified against the published keys, and permission checks are answered from cached grants, so a check normally costs no network call.

Node, whole-app and organization scopes
Fails closed when it can't answer
@UseGuards(CanopyTokenGuard, CanopyGuard)
@RequirePermission("invoice.approve", { scope: "org" })
@Post("invoices/:id/approve")
approve() {}
The hard parts

Handled, so you don't hand-roll them

The parts of an integration that are easy to get subtly wrong.

Generated types

Every operation's types come from the published OpenAPI document.

Typed errors

Error codes you can branch on, with helpers that map failures to the right status.

Retries and timeouts

Built into the client, with one paginator over every list.

Webhook verification

Signatures checked in constant time, with stale timestamps refused.

Token verification

Pins the algorithm, and checks the audience and token type.

Staying current

Cached, and still up to date

The local authorizer keeps its cache fresh, so a change you make reaches your checks without a redeploy.

Apply a webhook event as it arrives
Replay the change feed to catch up
Drop a cached person by hand

Webhooks

Signed events tell your service what changed.

Change feed

An ordered feed for catching up after downtime.

Other languages

Not on Node?

There's no SDK for other languages yet. The API is the supported route.

OpenAPI documents

Generate a client from the published documents.

Public REST API

The same operations the SDKs call.

Conformance vectors

Test cases to prove your own evaluator matches Canopy's.

Ready to simplify access control?

Create an account and have authentication and hierarchical access control running today.