SERVER SDK
One authorization call on your server.
Use the typed AccessVerdict JavaScript SDK from trusted backend code. Project API keys must never ship to a browser bundle.
Private Beta package status
@accessverdict/sdk v0.1.0 is implemented and build-ready. Public npm publication remains a deliberate release step.
Install
pnpm add @accessverdict/sdkVerify a wallet
import { createAccessVerdictClient } from "@accessverdict/sdk";
const accessVerdict = createAccessVerdictClient({
apiKey: process.env.ACCESSVERDICT_API_KEY!,
});
const result = await accessVerdict.verify({
policyId: process.env.ACCESSVERDICT_POLICY_ID!,
wallet: "0x0000000000000000000000000000000000000001",
});The SDK returns the same allowed, denied and error model as the REST API.
Treat denial and infrastructure failure differently
if (result.status === "error") {
return Response.json({ error: "authorization_unavailable" }, { status: 503 });
}
if (!result.allowed) {
return Response.json({ error: "forbidden" }, { status: 403 });
}Fail closed when verification is unavailable, but do not mislabel infrastructure failure as a normal policy denial.
Keep AccessVerdict secrets server-side
Never put av_test_... or av_live_... keys in browser JavaScript, localStorage, extension bundles or NEXT_PUBLIC_* variables.