From hootsuite-pack
Implements Hootsuite API rate limiting with Retry-After backoff, recursive retries, and PQueue queuing to handle 429 errors and optimize throughput.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin hootsuite-packThis skill is limited to using the following tools:
Handle Hootsuite API rate limits. The API returns `429 Too Many Requests` with `Retry-After` headers when limits are exceeded.
Optimizes Hootsuite API performance with LRUCache for profiles, PQueue batching for scheduling, and HTTPS agent pooling in TypeScript/Node.js.
Implements HubSpot API rate limiting with SDK retries, exponential backoff, jitter, and Retry-After handling for 429 errors and throughput optimization.
Handles Klaviyo API rate limits with Retry-After backoff, exponential retries, and queuing for 429 errors to optimize request throughput.
Share bugs, ideas, or general feedback.
Handle Hootsuite API rate limits. The API returns 429 Too Many Requests with Retry-After headers when limits are exceeded.
| Endpoint | Limit | Window |
|---|---|---|
| General API | Varies by plan | Per minute |
| Message scheduling | ~100/hour | Per hour |
| Media upload | ~50/hour | Per hour |
| Token refresh | ~10/hour | Per hour |
async function rateLimitedRequest(url: string, options: RequestInit = {}) {
const response = await fetch(url, {
...options,
headers: { 'Authorization': `Bearer ${process.env.HOOTSUITE_ACCESS_TOKEN}`, ...options.headers },
});
if (response.status === 429) {
const retryAfter = parseInt(response.headers.get('Retry-After') || '60');
console.log(`Rate limited. Retrying in ${retryAfter}s`);
await new Promise(r => setTimeout(r, retryAfter * 1000));
return rateLimitedRequest(url, options); // Retry
}
return response;
}
import PQueue from 'p-queue';
const hootsuiteQueue = new PQueue({
concurrency: 1,
interval: 1000,
intervalCap: 2, // 2 requests per second
});
async function queuedSchedule(profileId: string, text: string, time: Date) {
return hootsuiteQueue.add(() =>
fetch('https://platform.hootsuite.com/v1/messages', {
method: 'POST',
headers: { 'Authorization': `Bearer ${process.env.HOOTSUITE_ACCESS_TOKEN}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ text, socialProfileIds: [profileId], scheduledSendTime: time.toISOString() }),
})
);
}
For security, see hootsuite-security-basics.