yeetpost-node (yeetpost in npm) is a JavaScript library for posting to multiple social media platforms via one unified API.
Features:
- Post to multiple social media platforms via one unified API
- Zero external dependencies
- TypeScript support
npm install yeetpost
# or
yarn add yeetpost
# or
pnpm add yeetpostFirst, get your API key from https://app.yeetpost.com/settings.
Set it as in your .env or .env.local file:
# Store your API key in an environment variable
YEETPOST_API_KEY=your-api-keyOr pass it as an option to the yeetpost function:
import { yeetpost } from "yeetpost";
const result = await yeetpost({
apiKey: "your-api-key",
// other options...
});Send a new post:
import { yeetpost } from "yeetpost";
const result = await yeetpost({
connection: "linkedin", // connection slug, e.g. "linkedin", "x", etc.
text: "Hello, world!",
});If you don't care about the result, you can set noError: true:
import { yeetpost } from "yeetpost";
const result = await yeetpost({
connection: "linkedin",
text: "Hello, world!",
noError: true,
});Each platform has its own length limits (note that emojis consume more than 1 character):
| Platform | Usage Type | Length Limits | Docs |
|---|---|---|---|
| Message | See docs | Docs | |
| Post | See docs | Docs | |
| Slack | Message | See docs | Docs |
| SMS | Message | See docs | Docs |
| X (Twitter) | Post | See docs | Docs |
Your usage is limited by your subscription plan. Each plan includes a certain number of posts and a certain number of messages per month. Posts and messages are consumed based on the platform you're posting to:
- Posts: LinkedIn, X
- Messages: SMS, Email, Slack
Sends a post to a social media platform.
Usage:
import { yeetpost } from "yeetpost";
const result = await yeetpost({
connection: "linkedin",
text: "Hello, world!",
// Optional:
noError: true,
});
// Log the newly created post's link
console.log(result.link); // https://www.linkedin.com/feed/update/1234567890/1234567890interface YeetpostOptions {
connection: string;
text: string;
noError?: boolean;
}import { YeetpostResponse } from "yeetpost";import { yeetpost, YeetpostError } from "yeetpost";
try {
const result = await yeetpost({
connection: "linkedin",
text: "Hello, world!",
});
} catch (error) {
if (error instanceof YeetpostError) {
// An object with:
// - status: the HTTP status code
// - body: the error body
console.error(error.response);
}
}This package includes a CLI for yeetpost:
npx yeetpost <connection> <text>
# or
yarn yeetpost <connection> <text>Usage:
$ yeetpost --help
Usage:
yeetpost <connection> <text>
Options:
--help, -h Show this help message
--version, -v Show version
Configuration via environment variable:
YEETPOST_API_KEY=your-api-key yeetpost <connection> <text>
Configuration via .env or .env.local file:
Place your API key in the .env or .env.local file:
YEETPOST_API_KEY=your-api-key
Examples:
yeetpost linkedin "Hello, world!"
yeetpost x "Hello, world!"
yeetpost sms "Hello, world!"
yeetpost email "Hello, world!"
yeetpost slack "Hello, world!"MIT