TypeScript SDK
@pore/sdk is the official TypeScript client. It runs in Node.js 22+,
Cloudflare Workers, Deno, Bun, and Vercel Edge Functions.
Install
Section titled “Install”npm install @pore/sdkConstruct a client
Section titled “Construct a client”import { Pore } from "@pore/sdk";
const pore = new Pore({ apiKey: process.env.PORE_API_KEY!, // baseUrl defaults to https://api.pore.dev});Methods
Section titled “Methods”| Method | Endpoint |
|---|---|
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 |
Retries and timeouts
Section titled “Retries and timeouts”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 });Error handling
Section titled “Error handling”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;}