@verdify/sdk-ts
v0.8.0
Published
Verdify TypeScript SDK — generated typed REST client for auth.v1 + identity.v1, server-side only
Downloads
1,368
Readme
verdify-sdk-ts
The TypeScript client SDK for the Verdify platform, generated from verdify-contracts
(auth.v1 + identity.v1). Server-side only (D-On7): the browser never holds raw
tokens; consume this from a BFF / route handler.
Install
pnpm add @verdify/sdk-tsUsage
import { createVerdifyClient } from "@verdify/sdk-ts";
const sdk = createVerdifyClient({
authBaseUrl: process.env.AUTH_BASE_URL!,
identityBaseUrl: process.env.IDENTITY_BASE_URL!,
});
// Per-request cookie/trace forwarding via the optional context arg:
const r = await sdk.identity.getProfile(id, { headers: { cookie, traceparent } });
if (r.ok) useProfile(r.data);
else passThrough(r.status, r.error); // {error:{type,message,code,traceId,docsUrl?}}On the session-issuing auth calls, r.setCookies carries the upstream Set-Cookie
headers verbatim (string[]) so a server-side caller can forward/rewrite them — the auth
service issues tokens only as httpOnly cookies (ADR-0032). It is [] when the upstream sent
none (and on a transport failure).
Status
Wave 2a. Generated from verdify-contracts and released in lockstep with v1.
The generated-vs-handwritten split decision is documented in ADR-0001 in the source repository.
