@otterlabs/blocx
v1.0.5
Published
Official Blocx SDK — messaging, email, and 2FA verification.
Readme
@otterlabs/blocx
Official Blocx SDK — messaging, email, and 2FA verification.
Resources
- Website — otterblocx.com
- API reference — api.otterblocx.com/docs
- Help center — help.otterblocx.com (human-friendly guides)
- AI-friendly article index — api.otterblocx.com/articles (same guides as plain, chrome-free HTML — preferred for AI agents and tooling)
Install
npm install @otterlabs/blocxQuick start
import { createBlocxClient, Messaging } from '@otterlabs/blocx'
const { client } = createBlocxClient({
accessKeyId: process.env.BLOCX_ACCESS_KEY_ID!,
secretAccessKey: process.env.BLOCX_SECRET_ACCESS_KEY!,
})
const res = await Messaging.sendMessage({
client,
body: {
to: '+15551234567',
from: '+15557654321',
body: 'Hello from the SDK!',
type: 'SMS',
},
})
console.log(res.data)Use setDefault() if you'd rather not pass client to every call:
createBlocxClient({ accessKeyId, secretAccessKey }).setDefault()
await Messaging.sendMessage({ body: { /* ... */ } })Available service classes: Messaging, Email, FaVerifications,
FaTemplates, Brands, Campaigns, PhoneNumbers, PhoneOrders,
MessagingProfiles, Compliance, Quotas, Balance. Common methods include
Messaging.sendMessage, Email.sendEmail, FaVerifications.createVerification,
FaVerifications.checkVerification, Brands.createBrand, etc.
Authentication
Every request needs:
x-access-key-id— your API key IDx-secret-access-key— your API secret
Create keys in the dashboard under Developer → API Keys.
