CLI & SDKs
Command-line tools and developer SDKs
CLI & SDKs
ReplyNodes provides a Node.js SDK for developers who prefer scripting or programmatic access over calling the REST API directly.
CLI
A dedicated ReplyNodes command-line tool is not available yet. This section will be updated once one ships — in the meantime, use the Public API directly or the Node.js SDK below.
Node.js SDK
The @replynodes/node package provides a programmatic TypeScript/JavaScript SDK for the ReplyNodes API.
Installation
npm install @replynodes/nodeBasic Usage
import ReplyNodes from '@replynodes/node';
// Initialize with API key
const client = new ReplyNodes('your_api_key');
// Or with OAuth token
const client = new ReplyNodes('pos_your_oauth_token');
// Or with a custom API base URL (defaults to https://api.replynodes.com)
const client = new ReplyNodes('your_key', 'https://api.example.com');Creating Posts
const post = await client.post({
posts: [
{
value: [
{
text: 'Hello from Node.js SDK!',
image: [
{
path: 'https://example.com/image.jpg',
},
],
},
],
integrations: ['twitter', 'linkedin'],
},
],
});
console.log(post.id); // Post IDListing Posts
const posts = await client.postList({
skip: 0,
limit: 10,
type: 'published',
});
console.log(posts.posts);Uploading Media
const fs = require('fs');
// Upload a file
const file = fs.readFileSync('image.png');
const media = await client.upload(file, 'png');
console.log(media.path); // Use this path in postsFull SDK Methods
// Create a post
await client.post(postData);
// List posts with filters
await client.postList(filterOptions);
// Upload media file
await client.upload(fileBuffer, extension);
// Get integrations
await client.integrations();
// Delete a post
await client.deletePost(postId);TypeScript Support
The SDK's public methods (post, postList, upload, integrations, deletePost) are typed on the ReplyNodes class itself, but the request-body types (CreatePostDto for post(), GetPostsDto for postList()) are not currently re-exported from the @replynodes/node package — import only the default ReplyNodes class:
import ReplyNodes from '@replynodes/node';
const client = new ReplyNodes('your_key');
// Shape the request body to match what post() expects
const post = await client.post({
posts: [
{
value: [{ text: 'Hello!' }],
integrations: ['twitter'],
},
],
});Using ReplyNodes with AI Agents
To let an AI agent or code editor (Claude Code, Cursor, etc.) schedule posts and manage integrations on your behalf via natural language, connect it to the ReplyNodes MCP server instead of the SDK. See MCP Integration for setup instructions and the full list of available tools.
Examples
Schedule a Post from a Script
const ReplyNodes = require('@replynodes/node');
const client = new ReplyNodes(process.env.REPLYNODES_API_KEY);
async function schedulePost() {
const post = await client.post({
posts: [
{
value: [
{
text: `Daily post at ${new Date().toISOString()}`,
},
],
integrations: ['twitter', 'linkedin', 'instagram'],
},
],
releasedAt: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
});
console.log(`Post scheduled with ID: ${post.id}`);
}
schedulePost().catch(console.error);Batch Upload and Post
import ReplyNodes from '@replynodes/node';
import fs from 'fs';
const client = new ReplyNodes(process.env.REPLYNODES_API_KEY);
async function uploadAndPost() {
// Upload media
const imageFile = fs.readFileSync('campaign.png');
const media = await client.upload(imageFile, 'png');
// Create post with the uploaded media
const post = await client.post({
posts: [
{
value: [
{
text: 'New campaign! 🚀',
image: [{ path: media.path }],
},
],
integrations: ['twitter', 'linkedin', 'instagram'],
},
],
});
console.log(`Posted! ID: ${post.id}`);
}
uploadAndPost().catch(console.error);Troubleshooting
"API key invalid"
- Verify the key is correct in Settings → Public API → Access
- Check if the key has been rotated or revoked
- Try generating a new key
"Network error"
- Ensure you have internet connectivity
- Check firewall/VPN settings
- Verify
api.replynodes.comis accessible
Next Steps
- Public API Reference - Full REST API documentation
- MCP Integration - Use with AI code editors
- OAuth Applications - Build apps for other users