Skip to main content
The PindoSMS class is the entry point for the pindo-sms SDK. Instantiate it once with your API token and use it to send messages, manage sender IDs, and retrieve analytics.

Import

import { PindoSMS } from 'pindo-sms';

Constructor

new PindoSMS(token: string, baseUrl?: string, version?: string)
token
string
required
Your Pindo API token. Used to authenticate all requests as a Bearer token in the Authorization header.
baseUrl
string
default:"https://api.pindo.io"
The base URL of the Pindo API. Override this only if you are targeting a non-production environment.
version
string
default:"v1"
The API version to use for SMS endpoints. Affects the constructed URL for sendSMS and sendBulkSMS.

Authentication

All requests are authenticated using a Bearer token. The token you pass to the constructor is included automatically in the Authorization header of every request:
Authorization: Bearer <your-token>
You do not need to set headers manually on any method call.

Error handling

If the API returns a non-OK HTTP status, the SDK throws a JavaScript Error. The error message is taken from the API response body (errorData.message), falling back to 'API request error' if no message is present.
try {
  const result = await pindo.sendSMS({ to: '+250781234567', text: 'Hello', sender: 'Pindo' });
} catch (err) {
  console.error(err.message); // API error message or 'API request error'
}

Methods

sendSMS

Send a single SMS to one recipient.

sendBulkSMS

Send a personalized SMS to multiple recipients at once.

createSenderID

Register a custom sender ID for one or more countries.

getSenderIDs

Retrieve your registered sender IDs, optionally filtered by name.

getUserDetails

Fetch details about the authenticated organization.

getAnalytics

Retrieve SMS analytics for a given time range and timezone.

Build docs developers (and LLMs) love