Documentation Index
Fetch the complete documentation index at: https://docs.clientcommander.com/llms.txt
Use this file to discover all available pages before exploring further.
Initialization
Initialize the client with your API key.
import { ClientCommander } from '@clientcommander/sdk';
const cc = new ClientCommander({
apiKey: process.env.CCMD_API_KEY,
});
Error Handling
The SDK throws errors that contain useful debugging information.
try {
await cc.people.getPerson('invalid_id');
} catch (error) {
if (error.status === 404) {
console.error('Contact not found');
} else if (error.status === 429) {
console.error('Rate limit exceeded. Retry in', error.response.headers['retry-after']);
} else {
console.error('API Error:', error.message);
}
}
List endpoints return a meta object with pagination details.
// Fetch first page
const page1 = await cc.people.listPeople({ limit: 10 });
// Fetch next page if available
if (page1.meta.hasMore) {
const page2 = await cc.people.listPeople({
limit: 10,
cursor: page1.meta.nextCursor
});
}
TypeScript Support
The SDK exports all types for full type safety.
import type { Contact, Task } from '@clientcommander/sdk';
const myContact: Contact = {
firstName: 'Jane',
lastName: 'Smith'
// TypeScript will autocomplete available fields
};