Getting started
SDKs & libraries
Official Node SDK + ready-to-paste snippets for every other language. The REST API works equally well with whatever HTTP client you prefer.
Official Node.js SDK
Maintained in this repo. Zero runtime dependencies. Full TypeScript types.
npm install blueapi
Hello world:
hello.js
import { BlueReplies } from 'blueapi';const client = new BlueReplies({ apiKey: process.env.BLUEREPLIES_KEY });const msg = await client.messages.send({to: '+15551234567',body: 'Hello!',});console.log(msg.id, msg.status);
Available namespaces (1:1 with the REST resources):
client.messages // send, list, get, edit, unsend, react, typingclient.conversations // list, get, archiveclient.calls // initiate, list, get, end, voicemailclient.contacts // list, get, create, bulk, search, bulk-tag, exportclient.groups // create, list, get, addMember, removeMember, leaveclient.webhooks // create, list, update, delete, replayclient.lookup // lookup, bulkclient.media // upload, getclient.optOuts // list, create, bulk, deleteclient.lines // list, get
Webhook signature verification:
webhook.js
import { verifyWebhook } from 'blueapi';app.post('/webhooks/bluereplies', express.raw({ type: 'application/json' }), (req, res) => {const ok = verifyWebhook(req.body, req.headers['x-bluereplies-signature'], process.env.WEBHOOK_SECRET);if (!ok) return res.status(400).end();const evt = JSON.parse(req.body.toString('utf8'));// ... handle evt.event + evt.data ...res.json({ ok: true });});
Other languages
No official SDK exists for Python, Ruby, Go, PHP, or Elixir yet. Until then, the REST API works directly. Below are minimal HTTP clients for each.
bluereplies.py
import osimport httpxclass BlueReplies:def __init__(self, api_key: str | None = None):self.client = httpx.Client(base_url='https://api.bluereplies.com/v1',headers={'x-api-key': api_key or os.environ['BLUEREPLIES_KEY']},timeout=30,)def send_message(self, **kwargs):r = self.client.post('/messages', json=kwargs)r.raise_for_status()return r.json()def create_webhook(self, url: str, events: list[str]):r = self.client.post('/webhooks', json={'url': url, 'events': events})r.raise_for_status()return r.json()# Usagebr = BlueReplies()msg = br.send_message(to='+15551234567', body='Hello!')print(msg)
Want an official SDK in your language?
Tell us at [email protected] — we prioritize based on demand. Community SDKs welcome too.