| 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 = ();