Skip to content

JS SDK — @air/sdk-js

Server SDK for the AIR partner API: HMAC webhook verification + typed events.

  • Repo: https://github.com/Glowar-Ltd/air-sdk-js
  • Runnable example: examples/webhook-server in that repo.
import { handleWebhook } from "@air/sdk-js";

const result = handleWebhook({
  rawBody,                       // the raw request body string
  signingSecret,                 // your webhook signing secret
  signatureHeader,               // value of the X-AIR-Signature header
});
if (!result.ok) return res.writeHead(result.status).end(result.reason);
const event = result.envelope;   // typed: event.type + event.data