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

@ver-id/embedded-node-client

v0.2.0

Published

Ver.iD embedded-mode Node.js SDK: PKCE bootstrap + signed webhook verification + token exchange for embedded flows

Downloads

22

Readme

Ver.iD Embedded Node Client

npm version Build Status License: MIT TypeScript Node.js OAuth 2.1

The backend half of Ver.iD embedded mode. This package owns the confidential side of an embedded flow: it bootstraps PKCE, verifies signed webhooks, and exchanges the authorization code for tokens — all server-side. The browser half is @ver-id/embedded-browser-client, which holds no secrets and never sees the authorization code.

Getting Started

Installation

Using npm in your project directory run the following command:

npm install @ver-id/embedded-node-client

Using yarn in your project directory run the following command:

yarn add @ver-id/embedded-node-client

Using pnpm in your project directory run the following command:

pnpm add @ver-id/embedded-node-client

Usage

import { VeridEmbeddedDisclosureClient } from '@ver-id/embedded-node-client';

const client = new VeridEmbeddedDisclosureClient({ issuerUri, clientId });

app.post('/api/verid/start', async (_req, res) => {
  const bootstrap = await client.createEmbeddedSession({
    scope: 'openid disclosure',
    webhookUri: 'https://app.example.com/api/verid/webhook',
  });
  res.json(bootstrap); // { clientId, scope, state, codeChallenge, webhookUri, gatewayUri }
});

app.post('/api/verid/webhook', express.text({ type: '*/*' }), async (req, res) => {
  const result = await client.finalizeEmbedded({
    rawBody: req.body,
    signature: req.header('x-signature-256'),
    secret: process.env.VERID_WEBHOOK_SECRET!,
    clientAuth: { client_secret: process.env.VERID_CLIENT_SECRET! },
  });
  const token = await client.decode(result, assertDisclosureV1JwtPayload);
  await store(result.state, token);
  res.json({ received: true });
});

The same shape applies to VeridEmbeddedAuthenticationClient and VeridEmbeddedIssuanceClient. For issuance, create an intent first and forward its intentId via createEmbeddedSession — it is required there and throws InvalidArgumentError if omitted.

Security

  • The code_verifier never leaves the backend. createEmbeddedSession persists it against the state in the cache manager and returns only the public codeChallenge to the browser.
  • The authorization code arrives only via the HMAC-verified webhook. finalizeEmbedded rejects any webhook whose x-signature-256 header does not match an HMAC-SHA256 of the raw body computed with your flow's webhook secret (checked with a timing-safe comparison).
  • The token exchange sends no redirect_uri. Embedded flows are registered without one; the authorization code is bound to the client purely through PKCE.

Per-flow guides

For other comprehensive configurations and examples, see the per-flow documents:

  • Authentication — server-side embedded authentication with VeridEmbeddedAuthenticationClient.
  • Verification — server-side embedded disclosure with VeridEmbeddedDisclosureClient.
  • Issuance — server-side embedded issuance with VeridEmbeddedIssuanceClient (requires an intent).

License

MIT