Registry / messaging / sendblue

sendblue

JSON →
library3.10.0jsnpmunverified

The official TypeScript client library (v3.10.0, released monthly) for the Sendblue API, providing programmatic access to send SMS/MMS messages, manage contacts, and interact with Sendblue's messaging platform. Generated with Stainless for consistent ergonomics. Supports ESM only, includes full TypeScript definitions for all request params and response fields. Key differentiator: first-party SDK with full API coverage and auto-generated API documentation. Alternative to REST API calls and third-party HTTP clients.

npm install sendblue
INSTALL
IMPORT
SIG · SENDBLUE
S
sendblue
messagingjavascriptv3.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SendblueAPI (default)
import SendblueAPI from 'sendblue';
const SendblueAPI = require('sendblue');
ESM-only package; CommonJS require will fail. Use dynamic import() if needed in CJS.
MessageSendParams
import SendblueAPI from 'sendblue'; type MessageSendParams = SendblueAPI.MessageSendParams;
import { MessageSendParams } from 'sendblue';
All types are exported as properties of the default import, not as named exports. Access via `SendblueAPI.MessageSendParams`.
SendblueAPI.MessageResponse
import SendblueAPI from 'sendblue'; const response: SendblueAPI.MessageResponse = await client.messages.send(params);
import { MessageResponse } from 'sendblue';
Same pattern for response types — use default import's namespace.

Instantiates the client with API key and secret from environment variables, then sends an SMS message and logs the response seat_id.

import SendblueAPI from 'sendblue'; const client = new SendblueAPI({ apiKey: process.env.SENDBLUE_API_API_KEY ?? '', apiSecret: process.env.SENDBLUE_API_API_SECRET ?? '', }); async function main() { try { const messageResponse = await client.messages.send({ content: 'Hello from Sendblue!', from_number: '+1234567890', number: '+1987654321', }); console.log('Sent message with seat_id:', messageResponse.seat_id); } catch (error) { console.error('Error sending message:', error); } } main();
Debug
Known issues
gotchaESM-only package - using require('sendblue') will fail.
fix
Use import SendblueAPI from 'sendblue' or dynamic import() in CommonJS projects.
affects: >=3.0.0
deprecatedEnvironment variables SENDBLUE_API_API_KEY and SENDBLUE_API_API_SECRET are the default but must be set explicitly if not using defaults.
fix
Ensure env vars are named exactly SENDBLUE_API_API_KEY and SENDBLUE_API_API_SECRET (not SENDBLUE_API_KEY).
affects: >=3.0.0
gotchaAll TypeScript types are exported as static properties of the default import, not as named exports.
fix
Use SendblueAPI.MessageSendParams instead of destructuring { MessageSendParams } from 'sendblue'.
affects: >=3.0.0
gotchaOptional params in message.send may be required by the API — the SDK does not validate at compile time.
fix
Always consult API docs for required fields; TypeScript types may allow undefined where API requires a value.
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: sendblue_1.default is not a constructor
Using CommonJS require('sendblue') which returns an ESM module with no default export in CJS.
fix
Change to import SendblueAPI from 'sendblue' or use dynamic import: const SendblueAPI = (await import('sendblue')).default;
Error: Missing required param: from_number
The from_number parameter is missing or undefined in the request payload.
fix
Ensure from_number is a valid E.164 phone number string passed in the options object.
Property 'MessageSendParams' does not exist on type 'typeof import("...")'
Attempting to import MessageSendParams as a named export, but it is not exported that way.
fix
Use SendblueAPI.MessageSendParams type via the default import namespace.
Upgrade
Version history
3.10.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
18
OpenAI (training)
1
Resources