@dropreply/sdk
v1.0.0
Published
Official Node.js SDK for DropReply — publish replies on Reddit & X
Maintainers
Readme
DropReply Node.js SDK
Official Node.js SDK for DropReply — publish replies and upvotes on Reddit & X programmatically.
Installation
npm install dropreplyRequires Node.js 18+ (uses native fetch).
Quick Start
const DropReply = require('dropreply');
const client = new DropReply('drpl_live_sk_your_key_here');
// Submit a reply
const reply = await client.reply({
platform: 'reddit',
target_url: 'https://www.reddit.com/r/startup/comments/abc123/...',
content: 'Great point! We built something similar...'
});
console.log(reply.id); // 'rpl_abc123'
console.log(reply.status); // 'queued'Configuration
const client = new DropReply('drpl_live_sk_xxx', {
baseUrl: 'https://api.dropreply.com', // default
timeout: 30000 // request timeout in ms (default: 30s)
});Methods
client.reply(opts)
Submit a reply for publishing.
const reply = await client.reply({
platform: 'reddit', // 'reddit' or 'twitter'
target_url: 'https://...', // URL of the post to reply to
content: 'Your reply text', // 10–2000 characters
schedule_at: '2026-03-25T14:00:00Z' // optional: ISO 8601 datetime (Growth/Scale only)
});
// Returns:
// {
// id: 'rpl_abc123',
// status: 'queued', // or 'scheduled' if schedule_at was set
// platform: 'reddit',
// target_url: 'https://...',
// credit_cost: 1,
// schedule_at: null, // or the scheduled datetime
// created_at: '2026-03-22T...'
// }client.getReply(id)
Get the status and details of a reply.
const reply = await client.getReply('rpl_abc123');
// Returns:
// {
// id: 'rpl_abc123',
// platform: 'reddit',
// target_url: 'https://...',
// content: 'Your reply text',
// credit_cost: 1,
// status: 'published', // 'queued' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'rejected'
// published_url: 'https://...', // set when published
// schedule_at: null,
// published_at: '2026-03-22T...',
// created_at: '2026-03-22T...'
// }client.listReplies(opts)
List replies with optional filtering and pagination.
const result = await client.listReplies({
platform: 'reddit', // optional filter
status: 'published', // optional filter
limit: 10, // default: 20, max: 100
offset: 0 // pagination offset
});
// Returns:
// {
// data: [ { id, platform, status, ... }, ... ],
// pagination: { total: 42, limit: 10, offset: 0 }
// }client.upvote(opts)
Submit an upvote/like job.
const upvote = await client.upvote({
platform: 'reddit',
target_url: 'https://www.reddit.com/r/startup/comments/abc123/...'
});
// Returns:
// {
// id: 'upv_xyz789',
// status: 'queued',
// platform: 'reddit',
// target_url: 'https://...',
// credit_cost: 0.25,
// created_at: '2026-03-22T...'
// }client.usage()
Get current credit balance and plan info.
const usage = await client.usage();
// Returns:
// {
// plan: 'growth',
// credits_included: 100,
// credits_used: 23,
// credits_remaining: 77,
// extra_credits: 0,
// total_available: 77,
// billing_period_start: '2026-03-01T...',
// billing_period_end: '2026-04-01T...'
// }client.accountsAvailability(opts)
Check available managed accounts.
const result = await client.accountsAvailability({
platform: 'reddit' // optional filter
});
// Returns:
// {
// accounts: [
// { platform: 'reddit', available: 12 }
// ]
// }Error Handling
All methods throw DropReplyError on failure:
const { DropReplyError } = require('dropreply');
try {
await client.reply({ platform: 'reddit', target_url: '...', content: '...' });
} catch (err) {
if (err instanceof DropReplyError) {
console.error(err.statusCode); // HTTP status code (e.g. 400, 402, 422)
console.error(err.errorCode); // API error code (e.g. 'validation_error', 'insufficient_credits')
console.error(err.message); // Human-readable error message
}
}Common error codes:
validation_error(400) — Invalid input parametersinsufficient_credits(402) — Not enough creditsplan_required(403) — Feature requires a higher plan (e.g. scheduled replies)not_found(404) — Resource not foundmoderation_rejected(422) — Content failed moderationconcurrent_limit(429) — Too many replies in progressrate_limit_exceeded(429) — Too many requestsinternal_error(500) — Server error
License
MIT
