npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dpdpguard/server

v2.1.0

Published

DPDP Guard Server SDK (Node/TypeScript) - typed API client, consent gate, token broker, webhook verifier

Readme

dpdpguard-server-node-sdk

DPDP Guard Server SDK (Node/TypeScript) — typed API client, consent gate, token broker helper, and webhook signature verifier over DPDP Guard's public /api/v1 (spec §4.2).

Package: @dpdpguard/server

Part of the DPDP Guard SDK family. See the design spec: https://github.com/dpdp-guard-ai/dpdpbot/blob/main/docs/specs/mobile-server-sdk.md

Install

npm install @dpdpguard/server

Usage

import { DpdpGuardClient, hasConsent, verifyWebhookSignature } from "@dpdpguard/server";

const client = new DpdpGuardClient({
  baseUrl: "https://<your-deployment>.convex.site",
  apiKey: process.env.DPDP_SERVICE_API_KEY, // convex/apiKeys.ts, for broker-token only
});

// Mint a brokered principal access token (ADR-004 D1/D2) for a known user.
await client.brokerToken(externalId);

// Now authenticated calls use that token automatically.
const { requests } = await client.listDsrRequests();
await client.createDsrRequest({ organizationId, type: "erasure" });

// Public reads need no auth at all.
const org = await client.getOrganization("acme");
const { notices } = await client.getNotices(org.orgId);

// Verify an inbound webhook (convex/webhooks.ts's X-DPDP-Signature header).
const ok = verifyWebhookSignature(webhookSecret, rawBody, req.headers["x-dpdp-signature"]);

Every non-2xx response throws a DpdpGuardApiError with a code from the ADR-002 error catalog (err.code, e.g. "NOT_FOUND") and the HTTP status.

Contract

This package depends on @dpdpguard/contract as the single source of truth for the wire shape (ADR-001/002):

  • src/generated/api-types.ts is regenerated from the installed contract's openapi/v1.yaml via openapi-typescript (npm run codegen, also run automatically on npm install via postinstall and before npm run build). It's gitignored — never hand-edited, always regenerated.
  • src/errorCatalog.ts loads @dpdpguard/contract/conformance/error-catalog.json at runtime (ADR-002 D2) rather than hand-copying the error codes.
  • src/auditHash.test.ts runs @dpdpguard/contract/conformance/audit-hash-vectors.json as a required CI gate (ADR-002 D5) — a failure means this SDK's auditHash.ts has drifted from convex/lib/auditHash.ts.

Bumping the @dpdpguard/contract dependency and re-running npm run codegen is how this SDK picks up a new contract version; there is no separate manual sync step.

Scripts

| Script | Purpose | | --- | --- | | npm run codegen | Regenerate src/generated/api-types.ts from the installed contract | | npm test | Run the unit tests, including the golden-vector conformance gate | | npm run build | Codegen + tsc to dist/ |