Passmint
TemplatesDocsPricing
Log inGet started
Passmint
TemplatesDocsPricingTermsPrivacy

© 2026 Passmint. Built for indie makers.

← Docs

@passmint/node

The official Node.js SDK.

Typed, tested, ESM + CJS. Idempotency, retries, and webhook signature verification — all built in.

01

Install

npm install @passmint/node
02

Initialize

import { Passmint } from "@passmint/node"

const passmint = new Passmint({
  apiKey: process.env.PASSMINT_API_KEY!,
})
03

Passes

const pass = await passmint.passes.create({
  templateId: "tmpl_xxx",
  holderEmail: "alice@example.com",
  fieldValues: { seatNumber: "A12" },
}, { idempotencyKey: "purchase_42" })

const fetched = await passmint.passes.retrieve(pass.id)
const list = await passmint.passes.list({ limit: 100 })
await passmint.passes.void(pass.id)
const events = await passmint.passes.events(pass.id)
04

Templates

const templates = await passmint.templates.list()
const tpl = await passmint.templates.retrieve("tmpl_xxx")
05

Webhook signatures

Verify webhook signatures with the SDK helper. Timing-safe compare and a tolerance window — Stripe-style.

const event = passmint.webhooks.constructEvent(
  rawBody,
  request.headers["passmint-signature"]!,
  process.env.PASSMINT_WEBHOOK_SECRET!,
)
06

Errors

The SDK throws typed errors so you can branch cleanly:

  • PassmintError — base class
  • PassmintAPIError — non-2xx response
  • PassmintAuthError — bad or revoked API key
  • PassmintRateLimitError — includes retryAfterSeconds