| name | salesloft-sdk-patterns |
| description | Apply production-ready SalesLoft API patterns for TypeScript and Python.
Use when building SalesLoft integrations, implementing pagination,
or wrapping the REST API v2 with typed clients.
Trigger: "salesloft SDK patterns", "salesloft best practices", "salesloft client wrapper".
|
| allowed-tools | Read, Write, Edit |
| version | 1.6.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","sales","outreach","salesloft"] |
| compatibility | Designed for Claude Code |
SalesLoft SDK Patterns
Overview
Production-ready patterns for the SalesLoft REST API v2. There is no official TypeScript/Python SDK -- build a typed wrapper around https://api.salesloft.com/v2/ with automatic pagination, retry, and error normalization.
Prerequisites
- Completed
salesloft-install-auth setup
axios or node-fetch installed
- Familiarity with async/await and generics
Instructions
Step 1: Typed API Client Singleton
import axios, { AxiosInstance, AxiosError } from 'axios';
interface SalesloftPaging {
per_page: number;
current_page: number;
total_pages: number;
total_count: number;
}
interface SalesloftListResponse<T> {
data: T[];
metadata: { paging: SalesloftPaging };
}
interface SalesloftSingleResponse<T> {
data: T;
}
let instance: AxiosInstance | null = null;
export function getSalesloftClient(): AxiosInstance {
if (!instance) {
instance = axios.create({
baseURL: process.env. || ,
: { : },
: ,
});
instance...(, handleRateLimitError);
}
instance;
}