@vapi-ai/web 1.0.119 → 1.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,7 @@ class AtomicMediaSource {
25
25
  this.sourceBuffer.addEventListener("updateend", () => {
26
26
  resolve();
27
27
  });
28
+ console.log("APPEND");
28
29
  this.sourceBuffer.appendBuffer(buffer);
29
30
  } else {
30
31
  reject();
package/client.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Api } from "./api";
2
2
 
3
3
  const api = new Api({
4
- baseUrl: process.env.API_URL ?? "https://api.vapi.ai",
4
+ baseUrl: "https://api.vapi.ai",
5
5
  baseApiParams: {
6
6
  secure: true,
7
7
  },
@@ -22,6 +22,7 @@ class AtomicMediaSource {
22
22
  this.sourceBuffer.addEventListener("updateend", () => {
23
23
  resolve();
24
24
  });
25
+ console.log("APPEND");
25
26
  this.sourceBuffer.appendBuffer(buffer);
26
27
  }
27
28
  else {
package/dist/client.js CHANGED
@@ -8,12 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
- var _a;
12
11
  Object.defineProperty(exports, "__esModule", { value: true });
13
12
  exports.client = void 0;
14
13
  const api_1 = require("./api");
15
14
  const api = new api_1.Api({
16
- baseUrl: (_a = process.env.API_URL) !== null && _a !== void 0 ? _a : "https://api.vapi.ai",
15
+ baseUrl: "https://api.vapi.ai",
17
16
  baseApiParams: {
18
17
  secure: true,
19
18
  },
package/dist/vapi.d.ts CHANGED
@@ -6,7 +6,7 @@ export default class Vapi extends EventEmitter {
6
6
  private ws;
7
7
  private mediaRecorder;
8
8
  private player;
9
- constructor(apiToken: string);
9
+ constructor(apiToken: string, apiBaseUrl?: string);
10
10
  start(assistant: CreateAssistantDTO | string): void;
11
11
  private startRecording;
12
12
  private onMessage;
package/dist/vapi.js CHANGED
@@ -8,11 +8,12 @@ const events_1 = __importDefault(require("events"));
8
8
  const client_1 = require("./client");
9
9
  const base64_arraybuffer_1 = require("base64-arraybuffer");
10
10
  class Vapi extends events_1.default {
11
- constructor(apiToken) {
11
+ constructor(apiToken, apiBaseUrl) {
12
12
  super();
13
13
  this.started = false;
14
14
  this.ws = null;
15
15
  this.mediaRecorder = null;
16
+ client_1.client.baseUrl = apiBaseUrl !== null && apiBaseUrl !== void 0 ? apiBaseUrl : "https://api.vapi.ai";
16
17
  client_1.client.setSecurityData(apiToken);
17
18
  this.player = new player_1.ContinuousPlayer();
18
19
  this.player.on("speech-start", () => this.emit("speech-start"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vapi-ai/web",
3
- "version": "1.0.119",
3
+ "version": "1.0.121",
4
4
  "description": "",
5
5
  "main": "dist/vapi.js",
6
6
  "types": "dist/vapi.d.ts",
package/silent.mp3 ADDED
Binary file
package/vapi.ts CHANGED
@@ -10,8 +10,9 @@ export default class Vapi extends EventEmitter {
10
10
  private mediaRecorder: MediaRecorder | null = null;
11
11
  private player: ContinuousPlayer;
12
12
 
13
- constructor(apiToken: string) {
13
+ constructor(apiToken: string, apiBaseUrl?: string) {
14
14
  super();
15
+ client.baseUrl = apiBaseUrl ?? "https://api.vapi.ai";
15
16
  client.setSecurityData(apiToken);
16
17
  this.player = new ContinuousPlayer();
17
18