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). The support widget, also under config, has its own page: Support (widget).
| 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
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.
limitsand thepaymentMethodsamounts are integers in minor units (1000is 10.00 BRL withdecimalPlaces: 2). Format them withformatMoneyand the operator'scurrency(see Money). limits:minBet/maxBetalways 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 publicsiteKey(see Sign-up).otp:enabledand theflowsthat ask for a code (e.g.register,withdraw_money).timezoneanddefaultLanguageare 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).
Branding: config.getBranding
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
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
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).
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/querycarry a 5-minutestaleTimeand a public key, shared by every user (see Frameworks). - In Next.js, prefetch them in the layout with
prefetchEnginex(enginex, (q) => [q.config.get(), q.config.getBranding()]), or cache the call withfetchOptions: { next: { revalidate: 300 } }(see Next.js and Extensibility).
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:
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.