This SDK provides a type-safe way to interact with the Vapi API. It offers a convenient and strongly-typed interface for making HTTP requests to Vapi's REST endpoints, making it easier for developers to integrate Vapi services into their TypeScript or JavaScript projects.
Install
Install the package using npm:
npm install vapi-typescript-sdkOr using yarn:
yarn add vapi-typescript-sdkOr using pnpm:
pnpm add vapi-typescript-sdkUse
Example
Boilerplate
import { vapiClient } from 'vapi-typescript-sdk'
export const { GET, POST, PUT, PATCH, DELETE } = vapiClient({
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer YOUR_API_KEY_HERE',
},
})
// Fully typed + Autocompletion 🎉
const calls = await GET('/call', {
params: {
query: {
limit: 1000,
},
},
})