Provides static application configuration and runtime app-type resolution for the OpenMSP platform, with safe fallbacks for non-Next.js host environments. ## Key Components - **`APP_CONFIG`** — Immutable (`as const`) config object containing app identity (`type`, `name`, `domain`) and feature flags (`announcements`, `notifications`). - **`getAppConfig()`** — Returns the full `APP_CONFIG` object. - **`getAppType()`** — Resolves the active app type at runtime, reading `process.env.NEXT_PUBLIC_APP_TYPE` for Next.js/webpack static inlining, with a `try/catch` guard that returns `'openmsp'` in environments where `process` is unavailable (e.g., Vite, CRA embeds). ## Usage Example ```typescript import { getAppConfig, getAppType } from './app-config'; // Access full config const config = getAppConfig(); console.log(config.app.name); // 'OpenMSP' console.log(config.features.announcements); // true // Resolve app type at runtime (safe in Next.js and Vite/CRA embeds) const appType = getAppType(); console.log(appType); // 'openmsp' (or value of NEXT_PUBLIC_APP_TYPE) // Feature-flag guard if (getAppConfig().features.notifications) { // initialize notification system } ``` ## Notes - `NEXT_PUBLIC_APP_TYPE` must be set at **build time** in Next.js for webpack to statically inline it; runtime assignment has no effect. - The `try/catch` in `getAppType()` ensures embed hosts (Vite, CRA) that lack a global `process` object receive the `'openmsp'` fallback without throwing. - Dismissal cookies for announcements are domain-scoped, so the `'openmsp'` fallback is safe for single-platform embed deployments. **Source:** [`app-config.ts`](https://github.com/flamingo-stack/openframe-oss-lib/blob/main/app-config.ts)