Run experiments on static pages with Statsig and the Flags SDK
This example uses Statsig for feature flags with the Flags SDK along with the
@flags-sdk/statsig
https://flags-sdk-statsig.vercel.app/
This demo uses two feature gates on Statsig to control the visibility of two banners on the page. Both gates are configured to show/hide each banner 50% of the time.
Once you visit the page, you can see a variation of both/one/none of the banners. Since this example is using a stable id to identify users, you will see the same variation until you reset your id.
To test different variations, you can use the Dev Tools at the bottom to reset the stable id and reload the page. This allows you to test different variations of the banners.
If you deployed your own and configured the feature gates on Statsig, you can also use the Flags Explorer to test different variations by creating overrides.
The easiest way to get started with Statsig is through the native integration in the Vercel Marketplace.
In order to use the Flags Explorer, you need to link the project on your local machine.
vercel link
Select the project from the list you just deployed.
This allows the Flags SDK and the Flags Explorer to work correctly, by getting additional metadata.
vercel env pull
Head over to the Statsig Console and create the feature gates and experiments required by this template.
Ensure you select
Stable ID
User ID
Feature Gates:
Summer Sale
summer_sale
Stable ID
Free Shipping
free_delivery
Stable ID
Experiments:
Proceed to Checkout
proceed_to_checkout
Stable ID
You can also find the gate ids in the
flags.ts
Select the
Summer Sale
Free Shipping
Create a new rule by clicking on "+ Add New Rule" and set the percentage to 50%.
After that, click on "Save" at the bottom right corner.
Configure the
Proceed to Checkout
Control
Test
Test #2
color
string
blue
green
red
After that, start the Experiment.
If you provide the
STATSIG_CONSOLE_API_KEY
STATSIG_PROJECT_ID
This will show the description (if set) and displays a link to the feature gate on the Statsig Console.
You can find both values in the Statsig Console.
Run experiments on static pages with Statsig and the Flags SDK
This example uses Statsig for feature flags with the Flags SDK along with the
@flags-sdk/statsig
https://flags-sdk-statsig.vercel.app/
This demo uses two feature gates on Statsig to control the visibility of two banners on the page. Both gates are configured to show/hide each banner 50% of the time.
Once you visit the page, you can see a variation of both/one/none of the banners. Since this example is using a stable id to identify users, you will see the same variation until you reset your id.
To test different variations, you can use the Dev Tools at the bottom to reset the stable id and reload the page. This allows you to test different variations of the banners.
If you deployed your own and configured the feature gates on Statsig, you can also use the Flags Explorer to test different variations by creating overrides.
The easiest way to get started with Statsig is through the native integration in the Vercel Marketplace.
In order to use the Flags Explorer, you need to link the project on your local machine.
vercel link
Select the project from the list you just deployed.
This allows the Flags SDK and the Flags Explorer to work correctly, by getting additional metadata.
vercel env pull
Head over to the Statsig Console and create the feature gates and experiments required by this template.
Ensure you select
Stable ID
User ID
Feature Gates:
Summer Sale
summer_sale
Stable ID
Free Shipping
free_delivery
Stable ID
Experiments:
Proceed to Checkout
proceed_to_checkout
Stable ID
You can also find the gate ids in the
flags.ts
Select the
Summer Sale
Free Shipping
Create a new rule by clicking on "+ Add New Rule" and set the percentage to 50%.
After that, click on "Save" at the bottom right corner.
Configure the
Proceed to Checkout
Control
Test
Test #2
color
string
blue
green
red
After that, start the Experiment.
If you provide the
STATSIG_CONSOLE_API_KEY
STATSIG_PROJECT_ID
This will show the description (if set) and displays a link to the feature gate on the Statsig Console.
You can find both values in the Statsig Console.