Live
Library
Open Source
Vapi TypeScript SDK's logo

Vapi TypeScript SDK

Started in January 1, 2024 (almost 2 years ago)

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-sdk

Or using yarn:

yarn add vapi-typescript-sdk

Or using pnpm:

pnpm add vapi-typescript-sdk

Use

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,
    },
  },
})