Concepts

Most integration bugs come from mixing up token names or casting companyCode to an integer. Read this once before coding.

Token naming

NameWhat it isWhere it goes
BOT_TENANT_TOKENLong-lived secret from ChatAdmin (widget token)Server only — used when calling mint
API signatureShort-lived session id (~5 minutes)Returned by POST /api/chat/token
Init tenantTokenWidget init keyValue = mint signature
BOT_TENANT_TOKEN  ──mint──►  { signature }  ──init──►  Mimmo({ tenantToken: signature, systemName })
     (secret)                    (API JSON)                    (browser)

Identity keys

FieldRule
userCodeAlways use this — never userId. Number or string at mint; stored as string. Omit entirely for anonymous visitors (no 0 / null placeholders).
companyCodeAlways a string. Never (int) cast — codes like NETCO break.
systemNameMust match ChatAdmin System.systemName exactly for this tenant.

UCT unique key: (systemName, companyCode, userCode).

Session lifetime

  • Mint once per page load (or after login). Do not cache signatures for hours.
  • The widget can extend via /api/chat/token/extend while the tab is open.
  • Redis is mandatory on Mimmo for mint/resolve — see health checks.

Continue to Authentication.