"use client";

import { createPlatformClient } from "@bytelyst/platform-client";
import { PLATFORM_SERVICE_URL, PRODUCT_ID } from "@/lib/product-config";

export const platformClient = createPlatformClient({
  baseUrl: PLATFORM_SERVICE_URL,
  productId: PRODUCT_ID,
  getAccessToken: () => {
    if (typeof window === "undefined") return null;
    return localStorage.getItem(`${PRODUCT_ID}_access_token`);
  },
  refreshAccessToken: async () => false,
});
