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.
17 lines
499 B
TypeScript
17 lines
499 B
TypeScript
"use client";
|
|
|
|
import { createFeedbackClient, type FeedbackClient } from "@bytelyst/feedback-client";
|
|
import { PLATFORM_SERVICE_URL, PRODUCT_ID } from "@/lib/product-config";
|
|
import { getAccessToken } from "@/lib/api-helpers";
|
|
|
|
let _client: FeedbackClient | null = null;
|
|
export function getFeedbackClient(): FeedbackClient {
|
|
if (!_client) {
|
|
_client = createFeedbackClient({
|
|
baseUrl: PLATFORM_SERVICE_URL,
|
|
getAuthToken: () => getAccessToken() ?? "",
|
|
});
|
|
}
|
|
return _client;
|
|
}
|