If you're using the dynamicConfig.get("key", defaultValue)
method to fetch a value from a Dynamic Config in Statsig and receiving null
, it could be due to several reasons:
1. The key does not exist in the Dynamic Config: Ensure that the key you're trying to fetch is correct and exists in the Dynamic Config.
2. The Dynamic Config has not been initialized or fetched correctly: Check the initialization and fetching of the Dynamic Config. Make sure it has been done correctly as per the Statsig documentation.
3. Issue with the default value provided: There might be a problem with the default value you've provided. Verify that it is correct and compatible with the expected value type.
If you've verified the key, checked the initialization and fetching of the Dynamic Config, and ensured the default value is correct, but you're still receiving null
, it might be a more complex problem that requires further investigation. In such cases, we recommend flagging this issue for further assistance from the Statsig team.