In the scenario where config.getGroupName()
returns null in your SSR page using NextJS and Statsig, it's important to understand that the getGroupName()
function is expected to return null if the dynamic config does not have a group name associated with it. This could occur if the dynamic config is not part of an experiment group.
If you believe this is an error and the dynamic config should be part of a group, it's recommended to double-check your configuration in the Statsig console. If the issue persists, it might be a good idea to flag this for further investigation by the Statsig team.
In the case where you're calling getGroupName
on an experiment config, such as statsig.getExperiment('test').getGroupName()
, and it returns null or "undefined", it's possible that the groupName
is not included in the initializeValues
payload.
This issue might require a fix to the NodeSDK. The NodeSDK downloads the groupname via Statsig on initialization, but it doesn't include it in the payload generated by Statsig.getClientInitializeResponse
.
As a workaround for now, you can create a group name parameter in your experiment or config, and get that from the payload of the dynamic config. This should help you bypass the issue until a fix is implemented.