> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebuly.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

<Info>
  You can also provide the Nebuly API key in an environment variable
  NEBULY\_API\_KEY and it will be automatically detected.
</Info>

<Tabs>
  <Tab title="Python Client">
    ```python theme={null}
    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)
    ```

    <Note>
      In the case your code is async, you can benefit from the AsyncABTesting client.
    </Note>
  </Tab>

  <Tab title="Python Async Client">
    ```python theme={null}
    import asyncio

    from nebuly.ab_testing import AsyncABTesting

    client = AsyncABTesting("your_nebuly_api_key")


    async def main() -> None:
        variants = await client.get_variants(
            user="<user_id>",
            project_id="<project_id>",
            feature_flags=["feature_flag_a", "feature_flag_b"],
        )
        print(variants)


    if __name__ == "__main__":
        asyncio.run(main())
    ```
  </Tab>
</Tabs>
