SDK-backed admin center
1,248
OAuth sessions
99.98% success · secret due
18
EAV entities
3 synced today
8,420
AI credits
of 10,000 left
3/4
Published terms
refund policy draft
Runtime contract
// lib/brandapp-sdk.ts
import { createReoptEavClient } from "@reopt-ai/brandapp-sdk/eav";
import { createReoptTermsClient } from "@reopt-ai/brandapp-sdk/terms";
type BrandappClients = {
eav: ReturnType<typeof createReoptEavClient>;
terms: ReturnType<typeof createReoptTermsClient>;
};
let cachedClients: BrandappClients | undefined;
function readConfig() {
return {
clientId: process.env.BRANDAPP_CLIENT_ID!,
clientSecret: process.env.BRANDAPP_CLIENT_SECRET!,
brandappId: process.env.BRANDAPP_ID!,
baseUrl: process.env.REOPT_BASE_URL,
};
}
export function getBrandappClients() {
if (!cachedClients) {
const config = readConfig();
cachedClients = {
eav: createReoptEavClient(config),
terms: createReoptTermsClient(config),
};
}
return cachedClients;
}Health checks
SDK verifier
verifies server-only config before release
AI provider
Vercel AI SDK UIMessage stream
AI budget guard
enable before image or long reasoning runs
Webhook delivery
terms.published failed at customer endpoint
EAV schema
2 optional attrs need review
Terms fallback
refund draft falls back to i18n copy
Auth session
expires in 58 minutes
OAuth secret
rotation due within 7 days
SDK client cache
route handlers reuse server clients
BrandApp doctor
run before publishing config changes
Operations log
2 of 2 eventsSDK sync completed
okEAV, terms, auth, and AI clients checked 48 seconds ago
Schema drift detected
check2 optional EAV attrs need owner review