Skip to main content
The Web SDK reports errors as values, not exceptions.
  • show() and redeem() never reject: any failure (SDK not configured, network error, unexpected exception) resolves as { status: 'dismissed', reason: { type: 'error', error } }. No try/catch needed.
  • configure() returns false on invalid input (and logs the reason); it does not throw.
  • Fire-and-forget methods (identify(), setUserAttributes(), reset()) log errors to the console rather than throwing.

Reading an error from a result

For redeem(), an error result leaves the pending transaction untouched, so calling redeem() again later is safe. ({ status: 'none' } is never an error: it strictly means there was nothing pending to redeem.)

EncoreError

ErrorCode

INITIALIZATION_ERROR is the one you’ll most likely see during integration: it means a method ran before configure() succeeded.

The deferred pre-flight pair

A deferred show() checks the required host display values before any analytics or UI, and distinguishes two failure classes in its dismissed result:
  • CONFIGURATION_ERROR: the remote config loaded but a required field is genuinely absent. The message names each missing field with its fixes (pass it in display.*, or set it in the Encore portal). Fix the integration; retrying won’t help.
  • NETWORK_ERROR: the remote config was unreachable, so requiredness couldn’t be judged. Transient: the next show() call retries the fetch.