Python
AB Testing
The Nebuly SDK supports the AB Testing feature.
With the ABTesting Client you can get the different configured variants for a given user.
Get started with ABTesting
To get started with ABTesting, you need to create an instance of the ABTesting client. You need to pass your Nebuly API key as a parameter.
You can also provide the Nebuly API key in an environment variable NEBULY_API_KEY and it will be automatically detected.
from nebuly.ab_testing import ABTesting
client = ABTesting("your_nebuly_api_key")
variants = client.get_variants(
user="<user_id>",
project_id="<project_id>",
feature_flags=["feature_flag_a", "feature_flag_b"]
)
print(variants)
In the case your code is async, you can benefit from the AsyncABTesting client.