You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/customization/jwt-authentication.mdx
+2-13Lines changed: 2 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ For example, it can be used to restrict which API endpoints the token can access
31
31
32
32
<Note>
33
33
As of writing, the only publicly scoped API endpoint is
34
-
https://api.vapi.ai//call/web, which is used for Web Call creation. All other
34
+
https://api.vapi.ai/call/web, which is used for Web Call creation. All other
35
35
endpoints are privately scoped.
36
36
</Note>
37
37
@@ -136,18 +136,7 @@ If you set the scope to `public`, you can use it to make authenticated API reque
136
136
```
137
137
import Vapi from '@vapi-ai/web';
138
138
139
-
const vapi = new Vapi({
140
-
token: 'your-jwt-token',
141
-
});
139
+
const vapi = new Vapi('your-jwt-token');
142
140
143
141
vapi.start('your-assistant-id');
144
142
```
145
-
146
-
## Notes
147
-
148
-
- With the generated token, you can authenticate API requests to any endpoint requiring authentication. The token will be valid for the duration specified in the options (1 hour in this case).
149
-
- If you don't specify `token` in the JWT payload, the token will be public.
150
-
151
-
## Conclusion
152
-
153
-
This documentation covered the basics of generating a JWT token and demonstrated how to use the token to make authenticated API requests. Ensure that your environment variables (e.g., `ORG_ID` and `PRIVATE_KEY`) are correctly set up before running the code.
Copy file name to clipboardExpand all lines: fern/examples/inbound-support.mdx
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,10 +52,10 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
52
52
</Tab>
53
53
<Tabtitle="TypeScript (Server SDK)">
54
54
```typescript
55
-
import { Vapi } from"@vapi-ai/server-sdk";
55
+
import { VapiClient } from"@vapi-ai/server-sdk";
56
56
importfsfrom'fs';
57
57
58
-
const vapi =newVapi({ apiKey: "YOUR_VAPI_API_KEY" });
58
+
const vapi =newVapiClient({ token: "YOUR_VAPI_API_KEY" });
59
59
60
60
asyncfunction uploadFile(filePath:string) {
61
61
try {
@@ -138,9 +138,9 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
138
138
</Tab>
139
139
<Tabtitle="TypeScript (Server SDK)">
140
140
```typescript
141
-
import { Vapi } from"@vapi-ai/server-sdk";
141
+
import { VapiClient } from"@vapi-ai/server-sdk";
142
142
143
-
const vapi =newVapi({ apiKey: "YOUR_VAPI_API_KEY" });
143
+
const vapi =newVapiClient({ token: "YOUR_VAPI_API_KEY" });
144
144
145
145
const systemPrompt =`You are Tom, a friendly VapiBank customer support assistant. Help customers check balances and view recent transactions. Always verify identity with phone number first.`;
146
146
@@ -159,7 +159,7 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
159
159
},
160
160
voice: {
161
161
provider: "11labs",
162
-
voiceId: "burt"
162
+
voice_id: "burt"
163
163
}
164
164
});
165
165
@@ -193,7 +193,7 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
193
193
},
194
194
"voice": {
195
195
"provider": "11labs",
196
-
"voiceId": "burt"
196
+
"voice_id": "burt"
197
197
}
198
198
}
199
199
@@ -222,7 +222,7 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
222
222
},
223
223
"voice": {
224
224
"provider": "11labs",
225
-
"voiceId": "burt"
225
+
"voice_id": "burt"
226
226
}
227
227
}'
228
228
```
@@ -245,9 +245,9 @@ We will be creating a customer support agent for VapiBank, a bank that wants to
245
245
</Tab>
246
246
<Tabtitle="TypeScript (Server SDK)">
247
247
```typescript
248
-
import { Vapi } from"@vapi-ai/server-sdk";
248
+
import { VapiClient } from"@vapi-ai/server-sdk";
249
249
250
-
const vapi =newVapi({ apiKey: "YOUR_VAPI_API_KEY" });
250
+
const vapi =newVapiClient({ token: "YOUR_VAPI_API_KEY" });
Copy file name to clipboardExpand all lines: fern/quickstart/phone.mdx
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,10 +79,10 @@ Vapi makes it easy to build voice agents that can make and receive phone calls.
79
79
80
80
<Steptitle="Create the assistant">
81
81
```typescript
82
-
importVapifrom'@vapi-ai/server-sdk';
82
+
import{ VapiClient }from'@vapi-ai/server-sdk';
83
83
84
84
// Initialize the Vapi client
85
-
const vapi =newVapi({
85
+
const vapi =newVapiClient({
86
86
token: 'your-api-key', // Replace with your actual API key
87
87
});
88
88
@@ -111,7 +111,7 @@ Vapi makes it easy to build voice agents that can make and receive phone calls.
111
111
// Configure the voice
112
112
voice: {
113
113
provider: 'playht',
114
-
voiceId: 'jennifer',
114
+
voice_id: 'jennifer',
115
115
},
116
116
// Set the first message
117
117
firstMessage: 'Hi there, this is Alex from TechSolutions customer support. How can I help you today?',
@@ -136,16 +136,16 @@ Vapi makes it easy to build voice agents that can make and receive phone calls.
136
136
<Steps>
137
137
<Steptitle="Install the SDK">
138
138
```bash
139
-
pip install vapi-python
139
+
pip install vapi_server_sdk
140
140
```
141
141
</Step>
142
142
143
143
<Steptitle="Create the assistant">
144
144
```python
145
-
import vapi_python as vapi
145
+
from vapi import Vapi
146
146
147
147
# Initialize the Vapi client
148
-
client =vapi.Vapi(api_key="your-api-key") # Replace with your actual API key
148
+
client = Vapi(token="your-api-key") # Replace with your actual API key
149
149
150
150
# Define the system prompt for customer support
151
151
system_prompt ="""You are Alex, a customer service voice assistant for TechSolutions. Your primary purpose is to help customers resolve issues with their products, answer questions about services, and ensure a satisfying support experience.
@@ -172,7 +172,7 @@ Vapi makes it easy to build voice agents that can make and receive phone calls.
172
172
# Configure the voice
173
173
voice={
174
174
"provider": "playht",
175
-
"voiceId": "jennifer",
175
+
"voice_id": "jennifer",
176
176
},
177
177
# Set the first message
178
178
first_message="Hi there, this is Alex from TechSolutions customer support. How can I help you today?",
@@ -212,7 +212,7 @@ Vapi makes it easy to build voice agents that can make and receive phone calls.
212
212
},
213
213
"voice": {
214
214
"provider": "playht",
215
-
"voiceId": "jennifer"
215
+
"voice_id": "jennifer"
216
216
},
217
217
"firstMessage": "Hi there, this is Alex from TechSolutions customer support. How can I help you today?"
218
218
}'
@@ -420,9 +420,7 @@ Vapi makes it easy to build voice agents that can make and receive phone calls.
0 commit comments