UNPKG

@whop/react

Version:

React SDK for building embedded apps on Whop

13 lines (12 loc) 706 B
export function withWhopAppConfig(next, whopAppOptions = {}) { return async function applyWhopAppConfig(phase, defaults) { const resolvedConfig = typeof next === "function" ? await next(phase, defaults) : next; resolvedConfig.experimental ??= {}; resolvedConfig.experimental.serverActions ??= {}; resolvedConfig.experimental.serverActions.allowedOrigins ??= []; resolvedConfig.experimental.serverActions.allowedOrigins.push(`${whopAppOptions.domainId ?? "*"}.apps.whop.com`); resolvedConfig.experimental.optimizePackageImports ??= []; resolvedConfig.experimental.optimizePackageImports.push("frosted-ui"); return resolvedConfig; }; }