PostEverywhere — Official Node.js SDK

The official Node.js / TypeScript SDK for PostEverywhere — schedule and publish posts to Instagram, TikTok, YouTube, LinkedIn, Facebook, X (Twitter), Threads, and Pinterest from a single API. Build social media scheduling, content automation, and AI agent workflows in minutes.
💡 Building an AI agent? Try the companion @posteverywhere/mcp package — a Model Context Protocol server that lets Claude Code, Claude Desktop, Cursor, and other MCP-compatible clients schedule posts using natural language.
🔗 Quick Links
Why PostEverywhere SDK?
- One API, eight platforms — write once, publish to Instagram, TikTok, YouTube, LinkedIn, Facebook, X, Threads, and Pinterest
- Schedule posts at any future time with timezone awareness
- AI image generation built in (Flux, Ideogram, Gemini 3, Nano Banana Pro)
- Multi-platform publishing with per-platform content overrides
- Robust error handling with typed exceptions, automatic retries, and rate-limit awareness
- Full TypeScript support with rich type definitions
- AI-agent friendly — clean REST envelope,
retryable flags on every error, idempotency keys, circuit breaker
- Transparent pricing — flat plans from $19/mo, 7-day free trial, cancel anytime
A modern, API-first alternative to legacy social media management tools — designed for developers, AI agents, and automation-heavy workflows.
Install
npm install @posteverywhere/sdk
pnpm add @posteverywhere/sdk
yarn add @posteverywhere/sdk
Quick Start
import PostEverywhere from '@posteverywhere/sdk';
const client = new PostEverywhere({
apiKey: 'pe_live_your_api_key_here',
});
const { accounts } = await client.accounts.list();
console.log(accounts);
const post = await client.posts.create({
content: 'Hello from the PostEverywhere SDK! 🚀',
publish_now: true,
});
const scheduled = await client.posts.create({
content: 'Tomorrow morning',
scheduled_for: '2026-04-30T09:00:00Z',
timezone: 'America/New_York',
});
Getting Started
Accounts
const { accounts } = await client.accounts.list();
const account = await client.accounts.get(123);
Each account has a health field showing token status and whether it can post — useful for surfacing reconnect prompts to your users.
Posts
The core of the SDK. Create, schedule, edit, retry, and delete posts across all platforms.
const post = await client.posts.create({
content: 'My post content',
publish_now: true,
});
const scheduled = await client.posts.create({
content: 'Scheduled post',
scheduled_for: '2026-03-20T09:00:00Z',
timezone: 'America/New_York',
});
const targeted = await client.posts.create({
content: 'Just for Instagram and TikTok',
account_ids: [456, 789],
publish_now: true,
});
const withMedia = await client.posts.create({
content: 'Check out this photo!',
media_ids: ['media-uuid-here'],
publish_now: true,
});
const customized = await client.posts.create({
content: 'Default content',
platform_content: {
twitter: { content: 'Short version for X' },
linkedin: { content: 'Longer professional version for LinkedIn...' },
},
publish_now: true,
});
const { posts } = await client.posts.list({ status: 'done', limit: 10 });
const results = await client.posts.results('post-id');
await client.posts.retry('post-id');
await client.posts.update('post-id', { content: 'Updated content' });
await client.posts.delete('post-id');
📖 Full posts API reference →
Bulk Scheduling
Scheduled posts (with a future scheduled_for) bypass the per-minute publishing limit, so you can fire a month of content in parallel:
const posts = [
{ content: 'Monday morning', scheduled_for: '2026-04-01T09:00:00Z' },
{ content: 'Wednesday update', scheduled_for: '2026-04-03T12:00:00Z' },
{ content: 'Friday wrap-up', scheduled_for: '2026-04-05T16:00:00Z' },
];
const results = await Promise.allSettled(
posts.map(p =>
client.posts.create({
content: p.content,
account_ids: [2280, 2282],
scheduled_for: p.scheduled_for,
})
)
);
Media
Two paths depending on where your file lives:
One-call URL import (image-only, 25 MB cap) — new in v1.3.0
If your image is already at a public URL (web search result, OG image, hosted screenshot), this is the fastest path. Server fetches the bytes and returns a ready-to-attach media_id.
const media = await client.media.uploadFromUrl({
url: 'https://example.com/hero.webp',
});
await client.posts.create({
content: 'Photo post!',
account_ids: [123],
media_ids: [media.media_id],
});
Local files / videos / >25 MB images (3-step flow handled internally)
For local files or videos, client.media.upload(...) handles the full presign → PUT → complete dance internally.
import fs from 'fs';
const media = await client.media.upload(
fs.readFileSync('photo.jpg'),
{ filename: 'photo.jpg', contentType: 'image/jpeg' }
);
await client.posts.create({
content: 'Photo post!',
media_ids: [media.id],
publish_now: true,
});
Library management
const { media: files } = await client.media.list({ type: 'image' });
await client.media.delete('media-id');
📖 Media requirements per platform →
AI Image Generation
Generate images from text prompts using state-of-the-art models, then post them directly.
const image = await client.ai.generateImage({
prompt: 'A professional social media banner with abstract green shapes',
model: 'flux-schnell',
aspect_ratio: '16:9',
});
await client.posts.create({
content: 'AI-generated visual!',
media_ids: [image.media_id],
publish_now: true,
});
Available models: nano-banana-pro, ideogram-v2, gemini-3-pro, flux-schnell
Aspect ratios: 1:1, 16:9, 9:16, 4:3, 3:4, 4:5, 5:4
AI Agent Integration
The PostEverywhere API is designed to be agent-friendly:
retryable: false on every permanent error — agents know when to stop retrying
- Circuit breaker on identical-content failures (after 5 retries, returns
422 with permanent_failure_circuit_breaker) so runaway loops can't burn rate limits
- Stable error codes — programmatic error handling
- Comprehensive validation with explicit per-platform
validation_errors
Using a Claude/MCP-style agent? Skip this SDK and use @posteverywhere/mcp instead — natural-language scheduling via the Model Context Protocol. Works with Claude Code, Claude Desktop, Cursor, and other MCP-compatible clients.
📖 LLM agent system prompt template →
Error Handling
import PostEverywhere, {
AuthenticationError,
RateLimitError,
ValidationError,
InsufficientCreditsError,
PostEverywhereError,
} from '@posteverywhere/sdk';
try {
await client.posts.create({ content: 'Hello!' });
} catch (error) {
if (error instanceof AuthenticationError) {
console.error('Invalid API key — check your key at posteverywhere.ai/developers');
} else if (error instanceof RateLimitError) {
console.error('Rate limited, retry after:', error.retryAfter, 'seconds');
} else if (error instanceof ValidationError) {
console.error('Bad request:', error.details);
} else if (error instanceof InsufficientCreditsError) {
console.error('Not enough AI credits — upgrade or wait for monthly reset');
} else if (error instanceof PostEverywhereError) {
console.error('API error:', error.message, error.requestId);
}
}
Every error includes a retryable boolean — use it instead of inferring retry behavior from status codes.
📖 Full error reference →
Configuration
const client = new PostEverywhere({
apiKey: 'pe_live_...',
timeout: 120000,
maxRetries: 2,
});
Rate Limits
| General API calls | 60 | 1,000 | — |
| Posts | 60 | 200 | 1,000 |
| AI generation | — | 60 | — |
The SDK auto-retries on 429 with exponential backoff, respecting the Retry-After header. See Rate Limits for the full breakdown.
Supported Platforms
All eight platforms work on every plan — no per-network add-ons:
- Instagram Scheduler — feed, reels, stories, carousels
- TikTok Scheduler — videos, photo carousels
- YouTube Scheduler — videos with thumbnails, tags, descriptions
- LinkedIn Scheduler — text, images, video, documents (carousels)
- Facebook Scheduler — pages, video, reels, multi-image
- X (Twitter) Scheduler — text, threads, media, tier-aware char limits
- Threads Scheduler — text and media posts
- Pinterest Scheduler — pins to boards
Documentation
PostEverywhere Around the Web
- 🌐 PostEverywhere Homepage
- 🛠️ Developers Landing Page — overview of API, SDK, MCP, integrations
- 🤖 AI Agents Page — using PostEverywhere with Claude, ChatGPT, Cursor
- 💵 Pricing — Starter ($19), Growth ($39), Pro ($79); 7-day free trial
- ✍️ Blog — guides, tutorials, product updates
- 📚 Help Center — guides, troubleshooting, FAQs
- 🎛️ Dashboard (sign in)
- ✨ Sign Up — 7-day free trial
- 🔑 Get an API key
- 📦 Node.js SDK (npm — this package)
- 💻 Node.js SDK (GitHub — this repo)
- 📦 MCP Server (npm)
- 💻 MCP Server (GitHub)
- 🏢 PostEverywhere on GitHub
Per-Platform Schedulers
Every plan includes every platform — these are the per-platform landing pages:
Related
Support
License
MIT — see LICENSE.
Built by the team at PostEverywhere. The smarter way to schedule social media posts to Instagram, TikTok, YouTube, LinkedIn, Facebook, X, Threads, and Pinterest from one place.