Initialization
Initialize the client with your API key.Error Handling
The SDK throws errors that contain useful debugging information.Pagination
List endpoints return ameta object with pagination details.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Common patterns and examples for the Client Commander SDK
import { ClientCommander } from '@clientcommander/sdk';
const cc = new ClientCommander({
apiKey: process.env.CCMD_API_KEY,
});
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);
}
}
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
});
}
import type { Contact, Task } from '@clientcommander/sdk';
const myContact: Contact = {
firstName: 'Jane',
lastName: 'Smith'
// TypeScript will autocomplete available fields
};
