PostEverywhere SDK
Official Node.js/TypeScript SDK for PostEverywhere — schedule and publish to all social media platforms from code.
Install
npm install posteverywhere
Quick Start
import PostEverywhere from 'posteverywhere';
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,
});
Authentication
Get your API key from Settings → Developers in the PostEverywhere dashboard.
const client = new PostEverywhere({
apiKey: 'pe_live_...',
});
Accounts
const { accounts } = await client.accounts.list();
const account = await client.accounts.get(123);
Posts
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',
account_ids: [456],
publish_now: true,
});
const withMedia = await client.posts.create({
content: 'Check out this photo!',
media_ids: ['media-uuid-here'],
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');
Media
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,
});
const { media: files } = await client.media.list({ type: 'image' });
await client.media.delete('media-id');
AI Image Generation
const image = await client.ai.generateImage({
prompt: 'A professional social media banner with abstract 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
Error Handling
import PostEverywhere, {
AuthenticationError,
RateLimitError,
ValidationError,
InsufficientCreditsError,
} from 'posteverywhere';
try {
await client.posts.create({ content: 'Hello!' });
} catch (error) {
if (error instanceof AuthenticationError) {
console.error('Invalid API key');
} else if (error instanceof RateLimitError) {
console.error('Rate limited, retry after:', error.retryAfter);
} else if (error instanceof ValidationError) {
console.error('Bad request:', error.details);
} else if (error instanceof InsufficientCreditsError) {
console.error('Not enough AI credits');
}
}
Configuration
const client = new PostEverywhere({
apiKey: 'pe_live_...',
timeout: 120000,
maxRetries: 2,
});
Rate Limits
- General: 30 requests/min, 500 requests/hour
- Posting: 5 posts/min, 30 posts/hour, 100 posts/day
- AI: 15 generations/5min, 60/hour
The SDK automatically retries on rate limit errors with exponential backoff.
Supported Platforms
Instagram, TikTok, YouTube, LinkedIn, Facebook, X (Twitter), and Threads. All platforms included on every plan.
Links