learning_ai_notes/web/src/lib/platform.ts
saravanakumardb1 71062a57be fix(web): fix auth token key inconsistency and DRY getAccessToken()
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.
2026-04-13 09:59:18 -07:00

13 lines
381 B
TypeScript

"use client";
import { createPlatformClient } from "@bytelyst/platform-client";
import { PLATFORM_SERVICE_URL, PRODUCT_ID } from "@/lib/product-config";
import { getAccessToken } from "@/lib/api-helpers";
export const platformClient = createPlatformClient({
baseUrl: PLATFORM_SERVICE_URL,
productId: PRODUCT_ID,
getAccessToken,
refreshAccessToken: async () => false,
});