Star
Packages

@notifkit/provider-vonage

The Vonage (formerly Nexmo) SMS transport. Sends through the Vonage Messages API and verifies its signed status webhooks, feeding dead numbers and STOP replies into notifkit's delivery log and suppression list. Plain fetch, no SDK.

npm install @notifkit/provider-vonage
import { NotifkitServer } from "notifkit";
import { VonageTransport } from "@notifkit/provider-vonage";

const server = new NotifkitServer({
  services: ["all"],
  providers: [
    new VonageTransport({
      apiKey: process.env.VONAGE_API_KEY!,
      apiSecret: process.env.VONAGE_API_SECRET!,
      from: "+447700900001",
      signatureSecret: process.env.VONAGE_SIGNATURE_SECRET,
    }),
  ],
});

Options

OptionRequiredNotes
apiKeyyesAPI key from the Vonage Dashboard.
apiSecretyesAPI secret from the same page. Sent as HTTP basic auth.
fromyesDefault sender: a Vonage number in E.164 (+447700900001), or an alphanumeric sender ID (MyShop) where the destination country allows one. A template can override it.
signatureSecretnoThe signature secret from the Dashboard's API settings. Verifies status webhooks. Without it the webhook route is not mounted, and sends go out without delivery tracking.
loggernoA notifkit logger instance.
limitsnoProvider rate limit. Defaults to { limit: 75, windowSeconds: 1 }, the Messages API's default of 75 requests per second per API key.

A recipient's sms contact target is the phone number in E.164 (+447700900000). The transport drops the +, which Vonage does not accept. A destination with anything but digits, spaces and +().- (say, ext 12) fails without a send, so extra digits are never dialled as part of the number.

Which template keys it reads

Template keyLands as
text or bodyThe SMS text, up to 3,200 characters. A longer text is cut and ends in "…", because Vonage refuses it outright.
fromOverrides the constructor's sender for this template. A number loses its + and formatting; an alphanumeric sender ID is sent as written.

Status webhooks & suppressions

With signatureSecret set, the transport mounts /webhooks/vonage. To point Vonage at it:

  1. In the Vonage Dashboard, open API Settings and set the Messaging API type to Messages API. On SMS API, delivery receipts keep the legacy format and never reach this route.
  2. Set the Messages API version to v1.
  3. Set the account's Status URL to the route on your notifkit API, for example https://api.example.com/webhooks/vonage.
  4. Copy the Signature secret from the same page into signatureSecret.

Vonage signs every status webhook with a JWT in the Authorization: Bearer header (HS256, keyed by the signature secret). The transport checks the signature, pins the algorithm, and checks that the token's payload_hash matches the SHA-256 of the body, so a captured token can't carry another body. Anything else is rejected.

Vonage statusBecomesEffect
rejected with 1050, 1170, 1190, 1310 or 1430bounced (hard)The number is gone: it is suppressed for future SMS.
rejected with 1240 (STOP reply)unsubscribedThe recipient opted out: suppressed for future SMS.
rejected with any other codebounced (soft)Logged only. A block on Vonage's side, such as Fraud Defender's country block (1474), says nothing about the number.
undeliverablebounced (soft)Logged only. Vonage could not reach the carrier.
submitted, deliverednothingIgnored: the delivery log already records the send.

Failed sends

Vonage answerWhat notifkit does
A dead destination: 1050, 1170, 1190, 1240, 1430Stops retrying and, from notifkit 0.1.24, deactivates the contact.
Any other 4xx, such as rejected credentials or an invalid senderFails without a retry. A 401 never deactivates the contact: it is your own key.
HTTP 429, or codes 1000, 1241, 1461Waits for capacity instead of counting a failed attempt.
5xx, timeouts, network errors, or codes 1030, 1100, 1180, 1220, 1230, 1331Retried.

Codes are listed in Vonage's Messages API error reference.

Don't let a proxy rewrite the body

The signature covers the exact bytes Vonage sent. A proxy that re-serialises the JSON body makes payload_hash stop matching, and every webhook fails verification.