Automation

Node.js SDK

A thin, typed wrapper around the API. Everything it does, you can also do with fetch.

Base URLhttps://app.brokenpost.com/api/public/v1

Install

npm install @brokenpost/node

Schedule 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

MethodWhat 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.

Ready to post everywhere?

Connect your apps and schedule your first post in minutes. The Free plan costs $0, with no time limit.