To create your own StableID for server-side experiments, follow these steps:
1. Generate a unique identifier on your server. This could be a UUID or any other form of unique ID that you prefer.
2. Store this ID in a cookie or another method of your choice to be used on the client side as well.
3. Set this ID as the customID on the StatsigUser object when generating the initialize response from the SDK. Here's an example of how you can do this:
javascript const userObj = { customIDs: { stableID: '<generated in your code or passed via cookie or via db lookup>' } }
4. Get that ID from the cookie, and set it as the customID on the StatsigUser object when using the client SDK, so all event data and exposure checks tie back to the same user.
If you wish to use the stableID field rather than a custom ID, you still need to do step (2) above. Then:- Override the stableID in the client SDK by getting the value from the cookie and setting the overrideStableID parameter in StatsigOptions. - Set the stableID field on the StatsigUser object in the customIDs map when generating the initialize response from the SDK.
Please note that this information is based on the documentation's opinion.