feature-flags.ts and prompt-client.ts used bare 'access_token' key instead of PRODUCT_ID-prefixed key — auth tokens were never sent. Consolidates 10 web lib files to import the shared getAccessToken() from api-helpers.ts instead of each redefining their own copy.
15 lines
460 B
TypeScript
15 lines
460 B
TypeScript
"use client";
|
|
|
|
import { createWebDiagnostics } from "@bytelyst/diagnostics-client";
|
|
import { DIAGNOSTICS_URL, PRODUCT_ID } from "@/lib/product-config";
|
|
import { getAccessToken } from "@/lib/api-helpers";
|
|
|
|
const { init: initDiagnostics, stop: stopDiagnostics } = createWebDiagnostics({
|
|
productId: PRODUCT_ID,
|
|
channel: "notes_web",
|
|
serverUrl: DIAGNOSTICS_URL,
|
|
getAuthToken: () => getAccessToken() ?? "",
|
|
});
|
|
|
|
export { initDiagnostics, stopDiagnostics };
|