Skip to main content

How do server SDKs handle a failure to connect with Statsig?

Error Initializing

In Server SDKs, you may see an error message indicating that initialization failed. It is best practice to implement either:

  1. bootstrapValues and the rulesUpdatedCallback, to provide the definition of your gates/experiments in case of a network failure, or
  2. A Storage Adapter for a version of your gates/experiments locally (available in the PHP SDK, coming soon to others)

Error syncing

Server SDKs poll for changes to the definitions of your gates/configs/experiments every 10s, and changes to ID lists every 1 minute. If one of these fails, after a few retries, the SDK may output a warning indicating this is happening. The SDK will continue to operate with the last known definition of your project, and usually is able to resolve any issues by the next network request. In the case of a complete outage of Statsig API, the SDK will continue to operate offline with the last known set of feature gate and experiment definitions, and continue to retry connecting in the background..