{"id":41946,"library":"sendblue","title":"Sendblue TypeScript API Client","description":"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.","status":"active","version":"3.10.0","language":"javascript","source_language":"en","source_url":"https://github.com/sendblue-api/sendblue-ts","tags":["javascript","typescript"],"install":[{"cmd":"npm install sendblue","lang":"bash","label":"npm"},{"cmd":"yarn add sendblue","lang":"bash","label":"yarn"},{"cmd":"pnpm add sendblue","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only package; CommonJS require will fail. Use dynamic import() if needed in CJS.","wrong":"const SendblueAPI = require('sendblue');","symbol":"SendblueAPI (default)","correct":"import SendblueAPI from 'sendblue';"},{"note":"All types are exported as properties of the default import, not as named exports. Access via `SendblueAPI.MessageSendParams`.","wrong":"import { MessageSendParams } from 'sendblue';","symbol":"MessageSendParams","correct":"import SendblueAPI from 'sendblue'; type MessageSendParams = SendblueAPI.MessageSendParams;"},{"note":"Same pattern for response types — use default import's namespace.","wrong":"import { MessageResponse } from 'sendblue';","symbol":"SendblueAPI.MessageResponse","correct":"import SendblueAPI from 'sendblue'; const response: SendblueAPI.MessageResponse = await client.messages.send(params);"}],"quickstart":{"code":"import SendblueAPI from 'sendblue';\n\nconst client = new SendblueAPI({\n  apiKey: process.env.SENDBLUE_API_API_KEY ?? '',\n  apiSecret: process.env.SENDBLUE_API_API_SECRET ?? '',\n});\n\nasync function main() {\n  try {\n    const messageResponse = await client.messages.send({\n      content: 'Hello from Sendblue!',\n      from_number: '+1234567890',\n      number: '+1987654321',\n    });\n    console.log('Sent message with seat_id:', messageResponse.seat_id);\n  } catch (error) {\n    console.error('Error sending message:', error);\n  }\n}\n\nmain();","lang":"typescript","description":"Instantiates the client with API key and secret from environment variables, then sends an SMS message and logs the response seat_id."},"warnings":[{"fix":"Use import SendblueAPI from 'sendblue' or dynamic import() in CommonJS projects.","message":"ESM-only package - using require('sendblue') will fail.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Ensure env vars are named exactly SENDBLUE_API_API_KEY and SENDBLUE_API_API_SECRET (not SENDBLUE_API_KEY).","message":"Environment variables SENDBLUE_API_API_KEY and SENDBLUE_API_API_SECRET are the default but must be set explicitly if not using defaults.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Use SendblueAPI.MessageSendParams instead of destructuring { MessageSendParams } from 'sendblue'.","message":"All TypeScript types are exported as static properties of the default import, not as named exports.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Always consult API docs for required fields; TypeScript types may allow undefined where API requires a value.","message":"Optional params in message.send may be required by the API — the SDK does not validate at compile time.","severity":"gotcha","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'access':19 'altern':69 'api':3,16,61,67,72 'auto':65 'auto-gener':64 'call':73 'client':4,8,79 'consist':37 'contact':25 'coverag':62 'definit':45 'differenti':54 'document':68 'ergonom':38 'esm':40 'field':52 'first':56 'first-parti':55 'full':43,60 'generat':33,66 'http':78 'includ':42 'interact':27 'javascript':80 'key':53 'librari':9 'manag':24 'messag':23,31 'month':12 'offici':6 'param':49 'parti':57,77 'platform':32 'programmat':18 'provid':17 'releas':11 'request':48 'respons':51 'rest':71 'sdk':58 'send':21 'sendblu':1,15,29 'sms/mms':22 'stainless':35 'support':39 'third':76 'third-parti':75 'typescript':2,7,44,81 'v3.10.0':10","created_at":"2026-06-04T18:54:52.503136+00:00","updated_at":"2026-06-04T18:54:52.503136+00:00","problems":[{"fix":"Change to import SendblueAPI from 'sendblue' or use dynamic import: const SendblueAPI = (await import('sendblue')).default;","cause":"Using CommonJS require('sendblue') which returns an ESM module with no default export in CJS.","error":"TypeError: sendblue_1.default is not a constructor"},{"fix":"Ensure from_number is a valid E.164 phone number string passed in the options object.","cause":"The from_number parameter is missing or undefined in the request payload.","error":"Error: Missing required param: from_number"},{"fix":"Use SendblueAPI.MessageSendParams type via the default import namespace.","cause":"Attempting to import MessageSendParams as a named export, but it is not exported that way.","error":"Property 'MessageSendParams' does not exist on type 'typeof import(\"...\")'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/sendblue-api/sendblue-ts#readme","github":"https://github.com/sendblue-api/sendblue-ts","docs":null,"changelog":null,"pypi":null,"npm":"sendblue","openapi_spec":null,"status_page":null,"smithery":null,"categories":["messaging"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}