@passmint/node
Typed, tested, ESM + CJS. Idempotency, retries, and webhook signature verification — all built in.
npm install @passmint/nodeimport { Passmint } from "@passmint/node"
const passmint = new Passmint({
apiKey: process.env.PASSMINT_API_KEY!,
})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)const templates = await passmint.templates.list()
const tpl = await passmint.templates.retrieve("tmpl_xxx")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!,
)The SDK throws typed errors so you can branch cleanly:
PassmintError — base classPassmintAPIError — non-2xx responsePassmintAuthError — bad or revoked API keyPassmintRateLimitError — includes retryAfterSeconds