Skip to content

TypeScript SDK

@pore/sdk is the official TypeScript client. It runs in Node.js 22+, Cloudflare Workers, Deno, Bun, and Vercel Edge Functions.

Terminal window
npm install @pore/sdk
import { Pore } from "@pore/sdk";
const pore = new Pore({
apiKey: process.env.PORE_API_KEY!,
// baseUrl defaults to https://api.pore.dev
});
MethodEndpoint
pore.check(input)POST /v1/check
pore.checkBulk(input)POST /v1/check/bulk
pore.grants.create(input)POST /v1/grants
pore.grants.revoke(input)DELETE /v1/grants
pore.objects.list(query)GET /v1/objects
pore.namespaces.list()GET /v1/namespaces
pore.namespaces.create(input)POST /v1/namespaces

The client retries idempotent requests on transient failures (network error, HTTP 5xx, HTTP 429 with Retry-After). Retries are capped at three attempts with exponential backoff.

Timeout defaults: 5 seconds per request. Override per-call:

await pore.check(input, { timeoutMs: 1500 });

All client errors extend PoreError and carry the RFC 7807 problem identifier:

import { PoreError } from "@pore/sdk";
try {
await pore.check(input);
} catch (err) {
if (err instanceof PoreError && err.type === "invalid-subject") {
// handle bad subject identifier
}
throw err;
}