The Statsig C++ SDK for multi-user, server side environments. If you need a SDK for another language or single user client environment, check out our other SDKs.
Statsig helps you move faster with Feature Gates (Feature Flags) and Dynamic Configs. It also allows you to run A/B tests to validate your new features and understand their impact on your KPIs. If you're new to Statsig, create an account at statsig.com.
- Create a
.cmake
file that downloads the SDK at build time.
FetchContent_Declare(statsig
GIT_REPOSITORY https://github.com/statsig-io/private-cpp-server-sdk.git
GIT_TAG v0.1.0
)
FetchContent_MakeAvailable(statsig)
- Include the
.cmake
file in yourCMakeLists.txt
cmake_minimum_required(VERSION 3.11)
include(FetchContent)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/statsig.cmake)
- Configure build options (optional)
option(STATSIG_BUILD_TESTS "Compile with unit tests" OFF)
option(STATSIG_INCLUDE_MAXMINDDB "Include the 3rd party library maxminddb. (Disable if country lookup is not needed)" ON)
NOTE: Our SDK requires a minimum c++17 standard version
You can set the option set(STATSIG_BUILD_TESTS ON)
in your CMakeLists.txt
to include tests in your build.
To run the tests, use the command ctest --test-dir build/tests
See the ctest manual for more options.
- Pull requests are welcome!
- If you encounter bugs, feel free to file an issue.
- For integration questions/help, join our slack community.