---
url: https://game-engine-io.github.io/enginex-frontend-sdk/flows/config-branding.md
---
# Configuration and branding

The `config` namespace reads what the operator configured: currency, limits and payment methods
(`config.get`), visual identity (`config.getBranding`), enabled products (`config.getProducts`) and the
sportsbook (`config.getSportsbook`). Every method is **public**: it needs no login, sends the token only when
there is a session, and answers for the tenant of the request (see [Tenant and domains](/concepts/tenant)).
The support widget, also under `config`, has its own page: [Support (widget)](/flows/support).

| Method | Route | Returns |
| --- | --- | --- |
| `config.get()` | `GET /config` | `OperatorConfig`: currency, limits, payment methods, captcha, OTP, languages |
| `config.getBranding()` | `GET /config/branding` | `Branding`: name, colors, logos, legal links, contact, PWA |
| `config.getProducts()` | `GET /config/products` | `ProductsConfig`: products with route, order and status |
| `config.getSportsbook()` | `GET /config/sportsbook` | `SportsbookConfig`: provider and FIRST settings |

## Operator configuration: `config.get`

```ts
import { formatMoney } from '@getenginex/sdk'

const config = await enginex.config.get()

config.currency // { code: 'BRL', symbol: 'R$', name: 'Real brasileiro', decimalPlaces: 2 }
config.languages // ['pt-BR']
config.features.casino // true when the casino is turned on

const pix = config.paymentMethods.find((method) => method.code === 'pix')
if (pix?.supportsDeposit) {
  console.log(`Minimum deposit: ${formatMoney(pix.minDeposit, config.currency, 'pt-BR')}`)
}
```

* **Money in minor units.** `limits` and the `paymentMethods` amounts are integers in minor units
  (`1000` is 10.00 BRL with `decimalPlaces: 2`). Format them with `formatMoney` and the operator's `currency`
  (see [Money](/concepts/money)).
* **`limits`:** `minBet`/`maxBet` always come; the deposit and withdrawal limits and fees only come when the
  gateway identified the operator.
* **`captcha`:** whether sign-up requires a captcha, the provider and its public `siteKey` (see
  [Sign-up](/flows/sign-up)).
* **`otp`:** `enabled` and the `flows` that ask for a code (e.g. `register`, `withdraw_money`).
* **`timezone`** and **`defaultLanguage`** are optional: use them to show dates and pick the first language.

A domain that does not belong to any operator rejects with `INVALID_ARGUMENT`. Money or a currency outside
the format rejects with `VALIDATION_ERROR`, even with `validation: 'warn'` (see
[Response validation](/concepts/validation)).

## Branding: `config.getBranding`

```ts
const branding = await enginex.config.getBranding()

document.title = branding.operatorName
const root = document.documentElement
for (const [name, value] of Object.entries(branding.colors)) {
  // Colors the operator did not configure come as an empty string: keep the app's default.
  if (value !== '') root.style.setProperty(`--brand-${name}`, value)
}

const logo = document.querySelector<HTMLImageElement>('#logo')
if (logo) logo.src = branding.logos.logoFullDark
```

| Field | What it holds |
| --- | --- |
| `operatorId`, `operatorCode`, `operatorName`, `companyName` | who the operator is (display name and legal name) |
| `colors` | the full palette (`primaryColor`, `backgroundColor`, `lightPrimaryColor`, `gradientCta`...); a color not configured is `''` |
| `logos` | `logoFullLight` (for a light background) and `logoFullDark` (for a dark background) |
| `legal` | optional: `termsUrl`, `privacyUrl`, `responsibleGamblingUrl`, `cookiePolicyUrl` and `licenses` |
| `contact` | optional: `supportEmail`, `supportPhone` and `socialLinks` (name → URL) |
| `pwa` | optional: `appName`, `appShortName` and `appDescription` for the manifest |
| `integrations` | optional: `gtmId` and the Storyblok ids |

Every color key exists in `BrandingColors`, so `branding.colors.primaryColor` is typed without optional
chaining; check for `''` before using a value. `legal`, `contact`, `pwa` and `integrations` may be absent: read
them with `?.`.

## Products: `config.getProducts`

```ts
const { products } = await enginex.config.getProducts()

const menu = products
  .filter((product) => product.status === 'active')
  .sort((a, b) => a.displayOrder - b.displayOrder)
  .map((product) => ({ label: product.productName, href: product.routePath, icon: product.icon }))
```

Each `Product` has `productType` (e.g. `casino`, `sportsbook`, `predictions`), `routePath`, `displayOrder`,
`status` and `enabledFeatures`, plus free-form maps (`settings`, `limits` in minor units,
`integrationSettings`, `featureConfig`) whose keys the operator defines. `operatorId` and `operatorCode` are
absent when the gateway did not identify the tenant. Use `getProducts` to build the menu and the routes;
`config.get().features` only says which products are on.

## Sportsbook: `config.getSportsbook`

```ts
const sportsbook = await enginex.config.getSportsbook()

if (sportsbook.enabled && sportsbook.provider === 'first' && sportsbook.config) {
  const { sportsbookUrl, language, currency, liveBettingEnabled } = sportsbook.config
  console.log(sportsbookUrl, language, currency, liveBettingEnabled)
}
```

`config` (the FIRST settings: `siteId`, `sportsbookUrl`, `widgetUrl`, `language`, `currency`,
`liveBettingEnabled`, `cashoutEnabled`) only comes for the FIRST provider. Mounting the frame and creating
the player's session belong to iGaming: see [Sportsbook (FIRST)](/igaming/sportsbook).

## Caching

The configuration rarely changes. Read it once per app (or per request on the server) and keep it:

* With TanStack Query, the `config.*` factories of `@getenginex/sdk/query` carry a 5-minute `staleTime` and a
  public key, shared by every user (see [Frameworks](/frameworks/#queries-layer)).
* In Next.js, prefetch them in the layout with `prefetchEnginex(enginex, (q) => [q.config.get(),
  q.config.getBranding()])`, or cache the call with `fetchOptions: { next: { revalidate: 300 } }` (see
  [Next.js](/frameworks/next) and [Extensibility](/concepts/extensibility)).

```ts
import { createQueries } from '@getenginex/sdk/query'

const q = createQueries(enginex)
q.config.getBranding() // { queryKey: ['enginex', 'public', 'config', 'getBranding'], queryFn, staleTime: 300_000 }
```

## Testing

`createMockFetch()` answers the four routes with a mock operator (BRL, PIX, a casino product and FIRST
enabled). Override a route to test another operator:

```ts
import { createEnginexClient } from '@getenginex/sdk'
import { createMockFetch, ok } from '@getenginex/sdk/testing'

const enginex = createEnginexClient({
  baseUrl: 'https://gateway.test',
  tenantHost: 'casino.test',
  fetch: createMockFetch({
    routes: { 'GET /api/v1/config/products': () => ok({ products: [] }) },
  }),
})

const { products } = await enginex.config.getProducts() // []
```

See [Testing and mocks](/guide/testing).
