Resource-grouped TypeScript SDK for BlueBubbles.
- Primitives and types are generated by Hey API.
- Public client is a thin static wrapper over generated primitives.
- OpenAPI spec is derived from the official BlueBubbles Postman collection.
- Documentation: https://bluebubbles.anmho.com/
npm install @anmho/bluebubbles-sdkimport { BlueBubblesClient } from '@anmho/bluebubbles-sdk';
const client = new BlueBubblesClient({
baseUrl: 'http://localhost:1234',
password: 'your-server-password',
});
const chat = await client.chats.get({ path: { chatGuid: 'iMessage;+;12345' } });
const chats = await client.chats.query(); // optional input
await client.messages.sendText({
body: {
chatGuid: 'iMessage;+;12345',
message: 'hello from sdk',
},
});
const attachment = await client.attachments.download({ path: { guid: 'ATTACHMENT_GUID' } });client.attachments, client.backups, client.chats, client.contacts, client.fcm, client.handles, client.icloud, client.macos, client.messages, client.server, client.web, client.webhooks
import { WEBHOOK_EVENT_TYPES } from '@anmho/bluebubbles-sdk';
await client.webhooks.create({
url: 'https://example.com/webhooks/bluebubbles',
events: [WEBHOOK_EVENT_TYPES.NEW_MESSAGE, WEBHOOK_EVENT_TYPES.UPDATED_MESSAGE],
});
const event = client.webhooks.constructEvent(rawBody);
if (event.type === WEBHOOK_EVENT_TYPES.NEW_MESSAGE) {
console.log(event.data);
}npm run spec:download
npm run generatespec:download (optional spec refresh):
- Downloads the official Postman collection.
- Normalizes unresolved placeholders required by the converter.
- Converts Postman -> OpenAPI (
spec/openapi.yaml).
generate (normal SDK build path):
- Generates Hey API primitives and types to
src/generated.
spec/openapi.yaml is the source of truth for generation.
prepare_postman.ts is only used during spec:download to make Postman conversion reproducible.
From a clean checkout:
npm ci
npm run generate
npm testIf you want to refresh the spec first:
npm run spec:download
npm run generate
npm test- Create a feature branch and make your changes.
- Run local checks before opening a PR:
npm run generate
npm run build
npm test- For any user-facing SDK change, add a changeset:
npm run changesetChoose patch, minor, or major for @anmho/bluebubbles-sdk and include a short summary.
- Commit both your code changes and the generated
.changeset/*.mdfile.
Release flow:
- Merging PRs into
mainupdates/creates a release PR. - Merging the release PR publishes to npm and creates a GitHub Release.
spec:downloadgeneratebuildchecktestdocs:sync-openapidocs:devdocs:validate
- Do not hand-edit generated files in
src/generated. - The wrapper keeps BlueBubbles semantics and groups methods by resource.