| name | hootsuite-local-dev-loop |
| description | Configure Hootsuite local development with hot reload and testing.
Use when setting up a development environment, configuring test workflows,
or establishing a fast iteration cycle with Hootsuite.
Trigger with phrases like "hootsuite dev setup", "hootsuite local development",
"hootsuite dev environment", "develop with hootsuite".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pnpm:*), Grep |
| version | 1.5.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","hootsuite","social-media"] |
| compatibility | Designed for Claude Code |
Hootsuite Local Dev Loop
Overview
Set up a development workflow for Hootsuite API integrations with mocked API responses, token management, and testing.
Instructions
Step 1: Project Structure
hootsuite-integration/
โโโ src/
โ โโโ hootsuite/
โ โ โโโ client.ts # API client with token refresh
โ โ โโโ auth.ts # OAuth 2.0 flow
โ โ โโโ publishing.ts # Message scheduling
โ โ โโโ analytics.ts # Metrics retrieval
โ โโโ index.ts
โโโ tests/
โ โโโ fixtures/ # Mock API responses
โ โ โโโ profiles.json
โ โ โโโ messages.json
โ โโโ publishing.test.ts
โโโ .env.local
โโโ package.json
Step 2: API Client with Auto Token Refresh
import 'dotenv/config';
class HootsuiteClient {
private accessToken: string;
private refreshToken: string;
private expiresAt: number;
private base = 'https://platform.hootsuite.com/v1';
constructor() {
this.accessToken = process.env.HOOTSUITE_ACCESS_TOKEN!;
this.refreshToken = process.env.HOOTSUITE_REFRESH_TOKEN!;
this.expiresAt = Date.now() + 3600000;
}
async request(path: string, options: RequestInit = {}) {
(.() > . - ) .();
response = (, {
...options,
: { : , : , ...options. },
});
(!response.) ();
response.();
}
() {
res = (, {
: ,
: { : , : },
: ({ : , : . }),
});
tokens = res.();
. = tokens.;
. = tokens.;
. = .() + tokens. * ;
}
}
hootsuite = ();