An e-commerce example built with Hypertune and Flags SDK that works well with Vercel Marketplace
This example uses a template adapter for feature flags with the Flags SDK that works with the Flags Explorer.
https://flags-sdk-hypertune.vercel.app/
This demo shows different combinations of two banners on the home page. The banners 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 clone the example, you can also use the Flags Explorer to test different variations by creating overrides.
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
In the Hypertune dashboard, try this example by pasting the following schema into the Schema tab:
Use the Logic for this example
"""This `Context` input type is used for the `context` argument on your root field.It contains details of the current `user` and `environment`.You can define other custom input types with fields that are primitives, enumsor other input types."""input Context {stableId: String!environment: Environment!}type Root {delay: Int!proceedToCheckout: ProceedToCheckout!freeDelivery: Boolean!summerSale: Boolean!}enum Environment {developmentproductiontest}enum ProceedToCheckout {blueredgreen}
You will also need to create the logic for the flags to enable the flags to return different variants.
Create a Flag for the delay flag, and set the Type to Number.
Create a Test for each flag that splits traffic between users, and select the appropriate type for each flag.
Flags should be called
delay
proceedToCheckout
freeDelivery
summerSale
flags.ts
An e-commerce example built with Hypertune and Flags SDK that works well with Vercel Marketplace
This example uses a template adapter for feature flags with the Flags SDK that works with the Flags Explorer.
https://flags-sdk-hypertune.vercel.app/
This demo shows different combinations of two banners on the home page. The banners 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 clone the example, you can also use the Flags Explorer to test different variations by creating overrides.
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
In the Hypertune dashboard, try this example by pasting the following schema into the Schema tab:
Use the Logic for this example
"""This `Context` input type is used for the `context` argument on your root field.It contains details of the current `user` and `environment`.You can define other custom input types with fields that are primitives, enumsor other input types."""input Context {stableId: String!environment: Environment!}type Root {delay: Int!proceedToCheckout: ProceedToCheckout!freeDelivery: Boolean!summerSale: Boolean!}enum Environment {developmentproductiontest}enum ProceedToCheckout {blueredgreen}
You will also need to create the logic for the flags to enable the flags to return different variants.
Create a Flag for the delay flag, and set the Type to Number.
Create a Test for each flag that splits traffic between users, and select the appropriate type for each flag.
Flags should be called
delay
proceedToCheckout
freeDelivery
summerSale
flags.ts