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

@emblemapp/sdk

v2.2.0

Published

Emblem age-verification SDK — thin, contract-aligned client for the Publisher API v1

Readme

Emblem SDK v1

Contract-aligned SDK for the Emblem Publisher API (v1). This SDK is a thin adapter over HTTP and mirrors the public contract.

Requirements

  • Node.js 18+ for server usage

Install

npm install @emblemapp/sdk

Server usage (apiKey)

import { createClient } from '@emblemapp/sdk'

const client = createClient({
  apiKey: process.env.EMBLEM_API_KEY,
})

const start = await client.startVerification({
  integration_id: '00000000-0000-0000-0000-000000000000',
  callback_url: 'https://publisher.example/callback',
  state: 'abc123',
})

// result_token is returned via redirect or webhook after verification completes
const result = await client.validateVerification({
  result_token: resultTokenFromCallback,
})

Browser usage (publicKey)

import { createClient } from '@emblemapp/sdk'

const client = createClient({
  publicKey: 'emb_pk_live_123',
})

await client.startVerification({
  integration_id: '00000000-0000-0000-0000-000000000000',
  callback_url: 'https://publisher.example/callback',
})

Warning: Secret API keys must never be used in browser contexts. validateVerification() is server-only.

Errors, rate limiting, retries, timeouts

The SDK throws an EmblemApiError when the API returns an error envelope.

import { EmblemApiError } from '@emblemapp/sdk'

try {
  await client.startVerification({
    integration_id: '00000000-0000-0000-0000-000000000000',
    callback_url: 'https://publisher.example/callback',
  })
} catch (err) {
  if (err instanceof EmblemApiError) {
    // Stable error code from the API contract.
    console.log(err.code)

    // Optional error metadata.
    console.log(err.request_id, err.details)

    // Rate limiting: check the code and respect Retry-After when provided.
    if (err.isRateLimited) {
      console.log('retryAfter (seconds):', err.retryAfter)
    }
  }
}

This SDK is a thin HTTP wrapper and does not implement retries or request timeouts. If you need timeouts, provide a custom fetch implementation (e.g. using AbortSignal.timeout() in Node 18+).

Webhook verification

import { verifyWebhookSignature } from '@emblemapp/sdk'

const isValid = verifyWebhookSignature({
  // X-Emblem-Signature: t={unix_seconds},v1={hex_hmac}
  signature: signatureHeaderValue,
  // X-Emblem-Timestamp: {unix_seconds}
  timestamp: timestampHeaderValue,
  rawBody: rawBodyString,
  secret: process.env.EMBLEM_WEBHOOK_SECRET,
})

Note: verifyWebhookSignature() is server-only. It requires a webhook secret and Node.js crypto.

Important: rawBody must be the exact raw request body used to compute the signature.

Type generation

Types are generated from openapi/emblem-publisher-api.yaml and committed to the repo. To regenerate:

npm run types:generate

To verify types are up to date:

npm run types:check