realtime-avatar 0.4.0 → 0.4.1

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.
package/dist/express.js CHANGED
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
43
43
 
44
44
  // ../http-client/src/client.ts
45
45
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
46
- var SDK_VERSION = "0.4.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
package/dist/hono.js CHANGED
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
43
43
 
44
44
  // ../http-client/src/client.ts
45
45
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
46
- var SDK_VERSION = "0.4.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
43
43
 
44
44
  // ../http-client/src/client.ts
45
45
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
46
- var SDK_VERSION = "0.4.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
package/dist/nextjs.js CHANGED
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
43
43
 
44
44
  // ../http-client/src/client.ts
45
45
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
46
- var SDK_VERSION = "0.4.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
@@ -405,7 +405,8 @@ function useLiveKitAvatarGrant(input) {
405
405
  );
406
406
  useEffect(() => {
407
407
  if (!autoRetryBusy || !active || !tabVisible || state.status !== "busy" || !state.busy) return;
408
- const retryMs = Math.max(state.busy.recommended_retry_ms, 250);
408
+ const hinted = state.busy.recommended_retry_ms;
409
+ const retryMs = Math.max(Number.isFinite(hinted) ? hinted : 5e3, 250);
409
410
  const timer = window.setTimeout(refresh, retryMs);
410
411
  return () => window.clearTimeout(timer);
411
412
  }, [active, autoRetryBusy, tabVisible, refresh, state.busy, state.status]);
package/dist/react.js CHANGED
@@ -364,7 +364,8 @@ function useLiveKitAvatarGrant(input) {
364
364
  );
365
365
  useEffect(() => {
366
366
  if (!autoRetryBusy || !active || !tabVisible || state.status !== "busy" || !state.busy) return;
367
- const retryMs = Math.max(state.busy.recommended_retry_ms, 250);
367
+ const hinted = state.busy.recommended_retry_ms;
368
+ const retryMs = Math.max(Number.isFinite(hinted) ? hinted : 5e3, 250);
368
369
  const timer = window.setTimeout(refresh, retryMs);
369
370
  return () => window.clearTimeout(timer);
370
371
  }, [active, autoRetryBusy, tabVisible, refresh, state.busy, state.status]);
package/dist/server.js CHANGED
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
43
43
 
44
44
  // ../http-client/src/client.ts
45
45
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
46
- var SDK_VERSION = "0.4.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
@@ -43,7 +43,7 @@ var RealtimeAvatarHttpError = class extends RealtimeAvatarError {
43
43
 
44
44
  // ../http-client/src/client.ts
45
45
  var DEFAULT_BASE_URL = "https://realtimeavatar.ai/api/v1";
46
- var SDK_VERSION = "0.4.0";
46
+ var SDK_VERSION = "0.4.1";
47
47
  var RealtimeAvatar = class {
48
48
  #apiKey;
49
49
  #baseUrl;
@@ -60,7 +60,7 @@ var RealtimeAvatar = class {
60
60
  if (!options.apiKey) throw new RealtimeAvatarError("apiKey is required");
61
61
  this.#apiKey = options.apiKey;
62
62
  this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
63
- this.#fetch = options.fetch ?? globalThis.fetch;
63
+ this.#fetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
64
64
  this.#timeoutMs = options.timeoutMs ?? 6e4;
65
65
  this.#maxRetries = Math.max(0, options.maxRetries ?? 2);
66
66
  this.#userAgent = [`realtime-avatar-sdk/${SDK_VERSION}`, runtimeTag(), options.userAgent].filter(Boolean).join(" ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realtime-avatar",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Realtime Avatar SDK. `realtime-avatar` and the route adapters hold your API key and are server-only; `realtime-avatar/react`, `/browser` and `/tools` never can — importing a server entry into a browser build throws at bundle time.",
5
5
  "license": "MIT",
6
6
  "author": "The Influence Company",