TypeScript SDK
Use the Smobi client from a server-side TypeScript application.
Before You Begin
Obtain a brand-scoped API key, configure SMOBI_API_KEY in your server environment, and confirm that your brand has a messaging sender. Use a phone number you control for these examples.
Install
npm install smobi-sdk@0.3.11This guide is checked against version 0.3.11. Its generated types require content.rcs, so the example supplies RCS text with an SMS fallback. For SMS-only sends, use the HTTP quickstart.
Create a Client and Send a Message
import { SmobiClient } from 'smobi-sdk';
const apiKey = process.env.SMOBI_API_KEY;
if (!apiKey) throw new Error('SMOBI_API_KEY is required');
const client = new SmobiClient({ apiKey });
const result = await client.messaging.sendMessage(
{
clientRef: 'quickstart-001',
recipientPhoneNumber: '15552223333',
content: {
rcs: { content: { type: 'TEXT', content: 'Hello from Smobi!' } },
sms: { content: 'Hello from Smobi!' },
},
},
{ maxRetries: 0 },
);
console.log(result.smobiMessageId);Run this on your backend and replace the recipient with your own phone number. The example disables automatic retries for a send so an ambiguous failure is not blindly resubmitted.
Run a Workflow
const execution = await client.workflows.executeSingle(
'YOUR_WORKFLOW_DEFINITION_ID',
'15552223333',
{ variables: { customerName: 'Alex' } },
{ maxRetries: 0 },
);Supported Resources and Request Options
The SDK exposes messaging and workflows resources. For contact management, use the Contacts HTTP API.
Request options include timeoutInSeconds, maxRetries, and abortSignal. Keep a clear retry policy for message sends and workflow executions to avoid duplicate messages or executions after an uncertain response.
Consult the API Reference for request and response schemas. Review API compatibility and test your integration before upgrading the SDK.