@apian-labs/relay
v0.1.0
Published
Apian Labs Relay Node SDK
Readme
Apian Labs Relay Node SDK
What you will learn
This README shows how to send messages with the Relay SDK and verify webhook signatures. It also explains the basic client options and helper methods.
Install
npm install @apian-labs/relayUsage
import { Relay } from "@apian-labs/relay";
const relay = new Relay({
apiKey: process.env.API_KEY,
baseUrl: "https://api.apianlabs.com",
});
const message = await relay.sendMessage({
to: "+15551234567",
body: "Relay test",
testMode: true,
});
const trace = await relay.getTrace(message.messageId);Webhook verification
import { verifyWebhookSignature } from "@apian-labs/relay";
const isValid = verifyWebhookSignature(rawBody, headers, webhookSecret);Next steps
- Review the Relay docs in
docs/relay/. - Try the Next.js example in
examples/nextjs-send-and-trace/.
