Automation
Node.js SDK
A thin, typed wrapper around the API. Everything it does, you can also do with fetch.
Base URL
https://app.brokenpost.com/api/public/v1Install
npm install @brokenpost/nodeSchedule a post
import BrokenPost from '@brokenpost/node';
const brokenpost = new BrokenPost(process.env.BROKENPOST_API_KEY!);
const [channel] = await brokenpost.integrations();
await brokenpost.post({
type: 'schedule',
date: new Date(Date.now() + 3600_000).toISOString(),
shortLink: false,
tags: [],
posts: [
{
integration: { id: channel.id },
value: [{ content: 'Hello from the SDK', image: [] }],
settings: { __type: channel.identifier },
},
],
});Methods
| Method | What it does |
|---|---|
integrations() | List connected channels. |
post(body) | Create or schedule a post (same body as POST /posts). |
postList({ startDate, endDate }) | List posts in a date range. |
upload(buffer, extension) | Upload an image. |
deletePost(id) | Delete a post. |