tnzapi is a Node.js library for interacting with the TNZ Group REST API, supporting SMS, email, fax, text-to-speech (TTS), and voice messaging. Current stable version is 2.4.2. The library provides a unified client with namespaced messaging services (SMS, Email, Fax, TTS, Voice) and supports both Promise and callback patterns. It has moderate release cadence and is focused on New Zealand telecom services. Key differentiator is its all-in-one API for multiple communication channels in one package.
npm install tnzapiNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sends an SMS using the TNZ API client with authentication from environment variable.
Use exact method names as documented: SendMessage, GetStatus, etc.
Always use require('tnzapi') in Node.js; for ESM projects, use dynamic import or create a CJS wrapper.Use .then()/.catch() or async/await instead of passing a callback.
Replace 'import TNZAPI from "tnzapi"' with 'const TNZAPI = require("tnzapi")'.Ensure you pass an object with 'AuthToken' property to the TNZAPI constructor: new TNZAPI({ AuthToken: 'your-token' })Use client.Messaging.SMS.SendMessage instead of sendMessage.