From salesloft-pack
Sets up local SalesLoft development with TypeScript API client, fixtures, and Vitest mocking for offline integration testing.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin salesloft-packThis skill is limited to using the following tools:
Set up a local development workflow for SalesLoft integrations with API mocking, environment separation, and fast iteration. SalesLoft has no official sandbox -- use test data tagging and request recording for safe development.
Creates minimal SalesLoft API v2 examples in TypeScript: list people, create person, add to cadence. Use for integrations, setup testing, or learning People/Cadences patterns.
Sets up Apollo.io local dev workflow with sandbox keys, axios client for logged requests, and MSW mocks for offline API testing.
Sets up local Salesforce dev with scratch orgs, sf CLI, Node.js/jsforce integration, and hot reload for fast iteration cycles.
Share bugs, ideas, or general feedback.
Set up a local development workflow for SalesLoft integrations with API mocking, environment separation, and fast iteration. SalesLoft has no official sandbox -- use test data tagging and request recording for safe development.
salesloft-install-auth setup// src/salesloft/client.ts
import axios, { AxiosInstance } from 'axios';
export function createClient(token?: string): AxiosInstance {
return axios.create({
baseURL: process.env.SALESLOFT_BASE_URL || 'https://api.salesloft.com/v2',
headers: {
Authorization: `Bearer ${token || process.env.SALESLOFT_API_KEY}`,
'Content-Type': 'application/json',
},
});
}
// tests/fixtures/salesloft.ts
export const mockPerson = {
data: {
id: 1001, display_name: 'Test User', email_address: 'test@example.com',
first_name: 'Test', last_name: 'User', title: 'Engineer',
phone: '+1-555-0100', company_name: 'Acme Corp',
tags: ['dev_test'], created_at: '2025-01-15T10:00:00Z',
},
};
export const mockPeopleList = {
data: [mockPerson.data],
metadata: { paging: { per_page: 25, current_page: 1, total_pages: 1, total_count: 1 } },
};
export const mockCadence = {
data: {
id: 500, name: 'Test Outbound', team_cadence: false,
current_state: 'active', added_stage: 'prospecting',
cadence_framework_id: null, counts: { people_count: 10 },
},
};
export const mockActivity = {
data: {
id: 2001, action_type: 'email', person_id: 1001,
cadence_id: 500, step_id: 100, due_at: '2025-02-01T09:00:00Z',
},
};
// tests/salesloft.test.ts
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { createClient } from '../src/salesloft/client';
import { mockPeopleList, mockCadence } from './fixtures/salesloft';
vi.mock('axios', () => ({
default: { create: vi.fn(() => ({
get: vi.fn(), post: vi.fn(), put: vi.fn(), delete: vi.fn(),
}))},
}));
describe('SalesLoft People API', () => {
it('lists people with pagination metadata', async () => {
const client = createClient('test-token');
vi.mocked(client.get).mockResolvedValue({ data: mockPeopleList });
const { data } = await client.get('/people.json', { params: { per_page: 25 } });
expect(data.metadata.paging.total_count).toBe(1);
expect(data.data[0].email_address).toBe('test@example.com');
});
it('filters people by cadence membership', async () => {
const client = createClient('test-token');
vi.mocked(client.get).mockResolvedValue({ data: mockPeopleList });
const { data } = await client.get('/people.json', {
params: { cadence_id: 500, per_page: 25 },
});
expect(data.data.length).toBeGreaterThan(0);
});
});
# .env.development
SALESLOFT_BASE_URL=https://api.salesloft.com/v2
SALESLOFT_API_KEY=dev-token-here
SALESLOFT_TAG_PREFIX=dev_test_
# .env.test
SALESLOFT_BASE_URL=http://localhost:3001/mock
SALESLOFT_API_KEY=mock-token
{
"scripts": {
"dev": "tsx watch src/index.ts",
"test": "vitest",
"test:integration": "dotenv -e .env.development vitest run --config vitest.integration.ts"
}
}
PASS tests/salesloft.test.ts
SalesLoft People API
✓ lists people with pagination metadata (2ms)
✓ filters people by cadence membership (1ms)
| Error | Cause | Solution |
|---|---|---|
ECONNREFUSED | Mock server not running | Use vi.mock instead of live mock server |
401 in integration tests | Token expired | Refresh dev token from SalesLoft portal |
| Stale mock data | API response shape changed | Record fresh responses with interceptor |
Proceed to salesloft-sdk-patterns for production client patterns.