### Install Statsig Go SDK Source: https://www.statsig.com/trust/security Install the Statsig Go SDK using the go get command. This package enables server-side feature flagging in Go applications. ```Shell go get github.com/statsig-io/go-sdk@v1.1.1 ``` -------------------------------- ### Install Statsig Wizard for React and Next.js Source: https://www.statsig.com/trust/security Use the Statsig Wizard to install and manage Statsig SDKs for React and Next.js applications. This command-line tool simplifies the setup process. ```Shell npx @statsig/wizard@latest ``` -------------------------------- ### TypeScript: Bootstrapping Source: https://www.statsig.com/trust/security Tests the bootstrapping process for the Anthropic LLM SDK. This covers the initial setup and configuration required for the SDK to start operating. ```typescript bootstrapping.test.ts ``` -------------------------------- ### Install Statsig .NET SDK Source: https://www.statsig.com/trust/security Install the Statsig .NET SDK using the nuget command. This package provides server-side feature flagging capabilities for .NET applications. ```Shell nuget install Statsig ``` -------------------------------- ### Bootstrap Get Evaluations Test Source: https://www.statsig.com/trust/security Tests the bootstrapping process for getting evaluations. This covers the initial setup and data retrieval for evaluations. ```TypeScript get-evaluations-bootstrapping.test.ts ``` -------------------------------- ### Install Statsig React Native Bindings and Dependencies Source: https://www.statsig.com/trust/security Install the Statsig SDK for React Native applications. This includes the core JS client, React Native bindings, and necessary dependencies like AsyncStorage and DeviceInfo. ```Shell npm install @statsig/js-client @statsig/react-native-bindings npm install @react-native-async-storage/async-storage react-native-device-info ``` -------------------------------- ### Python: Initialize Diagnostics Source: https://www.statsig.com/trust/security Tests the initialization of diagnostics in Python server SDK. This includes verifying the setup and readiness of the diagnostics module. ```Python { "testFile": "diagnostics-init.test.ts", "testName": "Initialize Diagnostics", "includedInTest": true } ``` -------------------------------- ### TypeScript: Test Bootstrapping Get Evaluations Source: https://www.statsig.com/trust/security Tests the bootstrapping process for retrieving evaluations. This snippet likely verifies the initial setup and data fetching for evaluation purposes. ```TypeScript { "testFile": "get-evaluations-bootstrapping.test.ts", "testName": "Bootstraping Get Evaluations", "includedInTest": true } ``` -------------------------------- ### Go: Initialize Diagnostics Test Source: https://www.statsig.com/trust/security Tests the initialization of the diagnostics feature in the Go SDK. This includes verifying the setup and readiness of the diagnostics module. ```go func TestInitializeDiagnostics(t *testing.T) { // Test cases for initializing diagnostics } ``` -------------------------------- ### Install Statsig Java/Kotlin Server SDK Source: https://www.statsig.com/trust/security Configure your build.gradle file to include the Statsig Java/Kotlin server SDK. Ensure mavenCentral() is added to your repositories. ```Gradle repositories { mavenCentral() } implementation 'com.statsig:serversdk:1.20.0' ``` -------------------------------- ### Install Statsig Unity SDK Source: https://www.statsig.com/trust/security Add the Statsig Unity SDK to your project by navigating to Package Manager, selecting 'Add package from Git URL', and entering the provided URL. ```Shell Navigate to: Package Manager - add package from Git URL - https://github.com/statsig-io/unity-sdk.git ``` -------------------------------- ### Install Statsig Node.js Core SDK Source: https://www.statsig.com/trust/security Install the core Statsig SDK for Node.js applications using npm. This package provides server-side functionality for feature flagging and experimentation. ```Shell npm i @statsig/statsig-node-core ``` -------------------------------- ### Get Initialize Response (TypeScript) Source: https://www.statsig.com/trust/security Verifies the process of obtaining an initial response from the LLM. This test ensures that the system correctly initializes and provides the expected starting response. ```TypeScript get-init-response.test.ts ``` -------------------------------- ### Install Statsig JS Client for Client-Side JavaScript Source: https://www.statsig.com/trust/security Install the Statsig JavaScript client for client-side applications using npm. This enables feature flagging and experimentation directly in the browser. ```Shell npm install @statsig/js-client ``` -------------------------------- ### Install Statsig Python Core SDK Source: https://www.statsig.com/trust/security Install the Statsig Python core SDK using pip. This package allows you to integrate Statsig's features into your Python backend services. ```Shell pip install statsig-python-core ``` -------------------------------- ### Bootstrapping Source: https://www.statsig.com/trust/security Tests the bootstrapping process of the system. This is crucial for the initial setup and configuration. ```TypeScript bootstrapping.test.ts ``` -------------------------------- ### Initialize Diagnostics Test (.NET) Source: https://www.statsig.com/trust/security Tests the initialization of diagnostics for the .NET server SDK. This covers the setup and verification of diagnostic capabilities. ```C# diagnostics-init.test.ts ``` ```C# diagnostics-get-client-initialize-response.test.ts ``` -------------------------------- ### Initialize Statsig SDK (Python) Source: https://www.statsig.com/trust/security Initializes the Statsig SDK using a client SDK key in Python. This setup is necessary for leveraging Statsig's feature flagging capabilities within your Python application. ```python statsig.initialize("YOUR_CLIENT_SDK_KEY") ``` -------------------------------- ### Install Statsig C++ Client SDK Source: https://www.statsig.com/trust/security Integrate the Statsig C++ client SDK by downloading it from GitHub or using CMake's FetchContent. This allows for feature flagging in C++ applications. ```CMake Download from Github, OR include(FetchContent) FetchContent_Declare(statsig GIT_REPOSITORY https://github.com/statsig-io/cpp-client-sdk.git GIT_TAG main) FetchContent_MakeAvailable(statsig) ``` -------------------------------- ### Install Statsig Android SDK Source: https://www.statsig.com/trust/security Add the Statsig Android SDK to your project's build.gradle file. Note that Statsig uses jitpack for dependency management. ```Gradle dependencies { implementation 'com.github.statsig-io:android-sdk:4.32.1' } Note, we use jitpack for dependency management. See docs for more. ``` -------------------------------- ### Test Get Client Initialization Failure Behavior Source: https://www.statsig.com/trust/security Examines how the SDK handles initialization failures when using 'getClient'. This ensures graceful degradation and informative error reporting. ```typescript get-client-initialize-response-failure.test.ts ``` -------------------------------- ### Go: Get Client Initialize Response None Test Source: https://www.statsig.com/trust/security Tests the client initialization response when no specific hashing algorithm is used in the Go SDK. This covers the default or null hashing scenario. ```go func TestClientInitializeResponseNone(t *testing.T) { // Test cases for client initialization response with no hashing } ``` -------------------------------- ### TypeScript: Data Adapter Initialization Test Source: https://www.statsig.com/trust/security Tests the initialization of the data adapter. This snippet focuses on the setup and basic functionality of the data adapter within the TypeScript SDK. ```typescript describe('DataAdapter - Initialize', () => { // Test cases for DataAdapter initialization }); ``` -------------------------------- ### Install Statsig Swift SDK Source: https://www.statsig.com/trust/security Integrate the Statsig Swift SDK into your iOS project. You can add it via Swift Package Manager or by adding it to your Podfile. ```Shell Go to File > Swift Packages > Add Package Dependency and enter: 'https://github.com/statsig-io/ios-sdk.git' OR add to your Podfile: pod 'Statsig', '~> 1.20.1' ``` -------------------------------- ### Diagnostics - Init Success Test Source: https://www.statsig.com/trust/security Tests the successful initialization of diagnostics. This confirms that the diagnostic system can start up correctly. ```TypeScript diagnostics-init-success.test.ts ``` -------------------------------- ### SCIM User Provisioning Source: https://www.statsig.com/trust/security This snippet pertains to SCIM (System for Cross-domain Identity Management) user provisioning. It indicates functionality for automating user management and identity synchronization across different systems, enhancing security and efficiency. No code examples are provided. ```Python { "title": "\ud83c\udf89 SCIM User Provisioning", "slug": "scim", "date": 1730332800000 } ``` -------------------------------- ### TypeScript: Get Client Initialization Failure Behavior Source: https://www.statsig.com/trust/security Tests the behavior of client initialization failures in TypeScript. ```typescript get-client-initialize-response-failure.test.ts ``` -------------------------------- ### Install Statsig C++ Server SDK Source: https://www.statsig.com/trust/security Integrate the Statsig C++ server SDK into your CMake project. This involves declaring the SDK using FetchContent and including it in your build. ```CMake Add to your .cmake file: FetchContent_Declare(statsig GIT_REPOSITORY https://github.com/statsig-io/cpp-server-sdk.git GIT_TAG v0.1.0) FetchContent_MakeAvailable(statsig) And include in your CMakeLists.txt file: cmake_minimum_required(VERSION 3.11) include(FetchContent) include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/statsig.cmake) ``` -------------------------------- ### Multi Server Instances Initialize Source: https://www.statsig.com/trust/security Tests the initialization process for multiple server instances. This is relevant for distributed systems or high-availability setups. ```TypeScript multi-instance-initialize.test.ts ``` -------------------------------- ### Test Bootstrapping Get Evaluations Source: https://www.statsig.com/trust/security Tests the bootstrapping process for fetching evaluations. This TypeScript code verifies that the system can efficiently retrieve initial feature evaluations during startup. ```typescript import { expect, test } from "@jest/globals"; import { Client } from "../src/client"; test("Bootstraping Get Evaluations", async () => { const client = new Client({ apiKey: "key1" }); // Mocking the initial bootstrap response const mockBootstrapResponse = { success: true, data: { evaluations: { feature1: "variantA", feature2: "variantB", }, }, }; jest.spyOn(client as any, "fetchBootstrapData").mockResolvedValue(mockBootstrapResponse); await client.initialize(); // Assuming initialize triggers bootstrap // Verify that evaluations were fetched and potentially cached expect(client.checkFeature("feature1", "user1")).toBe("variantA"); expect(client.checkFeature("feature2", "user1")).toBe("variantB"); }); ``` -------------------------------- ### Test Get Evaluations - SHA256 Source: https://www.statsig.com/trust/security Tests the retrieval of evaluations using SHA256 hashing for configuration values. ```python import unittest from statsig import StatsigClient class TestGetEvaluationsSHA256(unittest.TestCase): def test_sha256_evaluations(self): # Test logic for SHA256 evaluations pass if __name__ == '__main__': unittest.main() ``` -------------------------------- ### Install Statsig PHP SDK Source: https://www.statsig.com/trust/security Add the Statsig PHP SDK to your project using Composer. This command integrates the SDK for server-side feature flagging in PHP applications. ```Shell composer require statsig/statsigsdk ``` -------------------------------- ### TypeScript: Get Client Initialize Response V2 Source: https://www.statsig.com/trust/security Tests the V2 functionality of retrieving the client initialize response in TypeScript. ```typescript get-client-initialize-response-hash-secondary-exposure.test.ts ``` ```typescript get-client-initialize-response-v2.test.ts ``` -------------------------------- ### Test Case for Get Initialize Response Source: https://www.statsig.com/trust/security This snippet contains a single test case for retrieving the initialization response from the Anthropic LLM system. The test is confirmed to be included in the current testing procedures. ```JSON { "testFile": "get-init-response.test.ts", "testName": "Get Initialize Response", "includedInTest": true } ``` -------------------------------- ### JavaScript: Get Client Initialize Response V2 Tests Source: https://www.statsig.com/trust/security Tests for the V2 client initialization response in the JavaScript SDK, including handling secondary exposures. ```JavaScript get-client-initialize-response-hash-secondary-exposure.test.ts Get Client Initialize Response V2 ``` ```JavaScript get-client-initialize-response-v2.test.ts Get Client Initialize Response V2 ``` -------------------------------- ### Test Get Initialize Response Source: https://www.statsig.com/trust/security Tests the retrieval of the initialization response from the client. This test is included in the test suite. ```typescript get-init-response.test.ts ``` -------------------------------- ### Test Get Client Initialization Failure Behavior Source: https://www.statsig.com/trust/security Tests the SDK's behavior when the client initialization fails, ensuring proper error handling and logging. ```typescript import * as getClientInitFailure from "../src/GetClientInitializeResponseFailure"; describe("Get Client Initialization Failure Behavior", () => { it("should handle initialization failure", () => { // Test logic for client initialization failure }); }); ``` -------------------------------- ### Go: Get Client Initialize Response Standard Test Source: https://www.statsig.com/trust/security Tests the standard response from the client initialization in the Go SDK. This covers the typical data structure and values returned. ```go func TestClientInitializeResponseStandard(t *testing.T) { // Test cases for standard client initialization response } ``` -------------------------------- ### PHP: Test Initialize Diagnostics Source: https://www.statsig.com/trust/security Tests the initialization of the diagnostics feature for the PHP server SDK. This verifies that the diagnostics module can be successfully started. ```PHP { "testFile": "diagnostics-init.test.ts", "testName": "Initialize Diagnostics", "includedInTest": false } ``` ```PHP { "testFile": "diagnostics-get-client-initialize-response.test.ts", "testName": "Initialize Diagnostics", "includedInTest": false } ``` -------------------------------- ### Python: Get Client Initialize Response V2 Source: https://www.statsig.com/trust/security Tests the V2 client initialization response in the Python server SDK. This snippet covers the general functionality and data structure of the V2 initialization response. ```Python { "testFile": "get-client-initialize-response-v2.test.ts", "testName": "Get Client Initialize Response V2", "includedInTest": true } ``` -------------------------------- ### Initialize Statsig SDK with Feature Gates and Dynamic Configs Source: https://www.statsig.com/trust/security This JavaScript snippet demonstrates how to initialize the Statsig SDK with predefined feature gates and dynamic configurations. It includes sample data for feature gates and dynamic configs, showcasing their structure and values. ```JavaScript window['$d'] = document.getElementById.bind(document); globalThis.statsigInitializeValues = decodeURIComponent("%7B%22feature_gates%22%3A%7B%22517893253%22%3A%7B%22name%22%3A%22517893253%22%2C%22value%22%3Afalse%2C%22rule_id%22%3A%225UUfG5OinUC3kdOf79TuCJ%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%22927426241%22%3A%7B%22name%22%3A%22927426241%22%2C%22value%22%3Afalse%2C%22rule_id%22%3A%22aECAN3xikxhnuu756BbEy%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%221046126327%22%3A%7B%22name%22%3A%221046126327%22%2C%22value%22%3Atrue%2C%22rule_id%22%3A%223tWm2ycYGYCU9KpKsiiVV6%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%221302717055%22%3A%7B%22name%22%3A%221302717055%22%2C%22value%22%3Atrue%2C%22rule_id%22%3A%223CrJNoBKhuQOqxw2kpwlJY%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%222210493336%22%3A%7B%22name%22%3A%222210493336%22%2C%22value%22%3Atrue%2C%22rule_id%22%3A%226rnN0980fvO3lVGGJxpLeF%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%223054069259%22%3A%7B%22name%22%3A%223054069259%22%2C%22value%22%3Atrue%2C%22rule_id%22%3A%224D9y00WvS5udHiZzqvhLjA%3A100.00%3A5%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%223075790271%22%3A%7B%22name%22%3A%223075790271%22%2C%22value%22%3Atrue%2C%22rule_id%22%3A%225GfbL0CDCfmI9uFAYzk2u4%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%223075790272%22%3A%7B%22name%22%3A%223075790272%22%2C%22value%22%3Atrue%2C%22rule_id%22%3A%2266gJM5JPWOyxz6v8dYhWDu%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%7D%2C%223114454104%22%3A%7B%22name%22%3A%223114454104%22%2C%22value%22%3Afalse%2C%22rule_id%22%3A%222r23lk8GAPJSNjegMl7yj2%22%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22userID%22%7D%7D%2C%22dynamic_configs%22%3A%7B%2253069540%22%3A%7B%22name%22%3A%2253069540%22%2C%22value%22%3A%7B%22style%22%3A%22%22%7D%2C%22group%22%3A%22BmurBCfLdfuQb8j4pd091%22%2C%22rule_id%22%3A%22BmurBCfLdfuQb8j4pd091%22%2C%22is_device_based%22%3Atrue%2C%22secondary_exposures%22%3A%5B%5D%2C%22group_name%22%3A%22Control%22%2C%22id_type%22%3A%22stableID%22%2C%22is_user_in_experiment%22%3Atrue%2C%22is_experiment_active%22%3Atrue%7D%2C%22111710687%22%3A%7B%22name%22%3A%22111710687%22%2C%22value%22%3A%7B%7D%2C%22group%22%3A%22prestart%22%2C%22rule_id%22%3A%22prestart%22%2C%22is_device_based%22%3Atrue%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%2C%22is_user_in_experiment%22%3Afalse%2C%22is_experiment_active%22%3Afalse%7D%2C%22309158954%22%3A%7B%22name%22%3A%22309158954%22%2C%22value%22%3A%7B%22precomputed%22%3A%7B%22android-client%22%3A%7B%22feat%3Adiagnostics-init%22%3A%7B%22passing%22%3Atrue%2C%22tests%22%3A%5B%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Lost%20Connection)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Success%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Cache%20Fallback)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(With%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(No%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%5D%7D%7D%2C%22dart-client%22%3A%7B%22feat%3Adiagnostics-init%22%3A%7B%22passing%22%3Afalse%2C%22tests%22%3A%5B%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Lost%20Connection)%22%2C%22includedInTest%22%3Afalse%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Success%22%2C%22includedInTest%22%3Afalse%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Cache%20Fallback)%22%2C%22includedInTest%22%3Afalse%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(With%20Retry)%22%2C%22includedInTest%22%3Afalse%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(No%20Retry)%22%2C%22includedInTest%22%3Afalse%2C%22test_is_required_to_pass%22%3Atrue%7D%5D%7D%7D%2C%22ios-client%22%3A%7B%22feat%3Adiagnostics-init%22%3A%7B%22passing%22%3Atrue%2C%22tests%22%3A%5B%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Lost%20Connection)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Success%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Cache%20Fallback)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(With%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(No%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%5D%7D%7D%2C%22unity-client%22%3A%7B%22feat%3Adiagnostics-init%22%3A%7B%22passing%22%3Atrue%2C%22tests%22%3A%5B%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Lost%20Connection)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Success%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Cache%20Fallback)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(With%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(No%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%5D%7D%7D%2C%22web-client%22%3A%7B%22feat%3Adiagnostics-init%22%3A%7B%22passing%22%3Atrue%2C%22tests%22%3A%5B%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Lost%20Connection)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Success%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(Cache%20Fallback)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(With%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%2C%7B%22testName%22%3A%22Diagnostics%20-%20Init%20Failure%20(No%20Retry)%22%2C%22includedInTest%22%3Atrue%2C%22test_is_required_to_pass%22%3Atrue%7D%5D%7D%7D%7D%2C%22rule_id%22%3A%224D9y00WvS5udHiZzqvhLjA%3A100.00%3A5%22%2C%22is_device_based%22%3Atrue%2C%22secondary_exposures%22%3A%5B%5D%2C%22id_type%22%3A%22stableID%22%2C%22is_user_in_experiment%22%3Atrue%2C%22is_experiment_active%22%3Atrue%7D%7D%2C%22user%22%3A%7B%22userID%22%3A%22test_user ``` -------------------------------- ### Get Initialize Response Test Source: https://www.statsig.com/trust/security Tests the retrieval of the initialization response from the system. This verifies the initial configuration data is correctly provided. ```TypeScript get-init-response.test.ts ``` -------------------------------- ### Initialize Statsig SDK (Java) Source: https://www.statsig.com/trust/security Sets up the Statsig SDK in a Java environment with the provided client SDK key. Proper initialization ensures that feature flags and experiments are correctly managed. ```java Statsig.initialize(context, "YOUR_CLIENT_SDK_KEY"); ``` -------------------------------- ### Go: Get Client Initialize Response DJB2 Test Source: https://www.statsig.com/trust/security Tests the client initialization response using the DJB2 hashing algorithm in the Go SDK. This verifies responses when DJB2 is applied. ```go func TestClientInitializeResponseDJB2(t *testing.T) { // Test cases for client initialization response with DJB2 } ``` -------------------------------- ### Get Client Initialize Response V2 Source: https://www.statsig.com/trust/security Tests the second version of the client initialization response. This covers general improvements or changes in the initialization API. ```TypeScript get-client-initialize-response-v2.test.ts ``` -------------------------------- ### Test Bootstrapping Source: https://www.statsig.com/trust/security Tests the general bootstrapping mechanism of the client. This TypeScript code verifies that the client can be initialized and start fetching data correctly. ```typescript import { expect, test } from "@jest/globals"; import { Client } from "../src/client"; test("Bootstraping", async () => { const client = new Client({ apiKey: "key1" }); // Mocking a successful bootstrap response const mockBootstrapResponse = { success: true, data: { message: "Bootstrap successful" } }; jest.spyOn(client as any, "fetchBootstrapData").mockResolvedValue(mockBootstrapResponse); await client.initialize(); expect(client).toBeDefined(); // Add assertions to check if the client is in an initialized state }); ``` -------------------------------- ### Initialize Client Instance Source: https://www.statsig.com/trust/security Tests the initialization of a single client instance for the Anthropic LLMs SDK. This is a fundamental step for using the SDK's features. ```typescript import { StatsigClient, InitializeResponse, } from "../src"; describe("Initialize", () => { it("should initialize the client successfully", async () => { const client = new StatsigClient("secret-key", { userID: "testUser", }); await client.initialize(); expect(client.isInitialized()).toBe(true); }); }); ``` -------------------------------- ### Go: Multi Server Instances Initialize Test Source: https://www.statsig.com/trust/security Tests the initialization process for multiple server instances within the Go SDK. This snippet covers scenarios involving concurrent or multiple SDK instances. ```go func TestMultiServerInstancesInitialize(t *testing.T) { // Test cases for multi server instances initialization } ``` -------------------------------- ### Install Statsig Rust SDK Source: https://www.statsig.com/trust/security Add the Statsig Rust SDK to your Cargo project using the cargo add command. This integrates Statsig's features into your Rust applications. ```Shell cargo add statsig ``` -------------------------------- ### Get Experiment Value (Python) Source: https://www.statsig.com/trust/security Fetches the value of a specific parameter from an experiment in Python. This is used to get A/B test assignments for users. ```python experiment_value = statsig.get_experiment("my_experiment").get("button_color", "blue") ``` -------------------------------- ### Install Statsig Erlang/Elixir SDK Source: https://www.statsig.com/trust/security Add the Statsig SDK to your Erlang or Elixir project. Instructions are provided for both Hex package management and direct dependency inclusion. ```Elixir {:statsig, "~> 0.0.1"} {:statsig, "0.0.1"}. OR dep_statsig = hex 0.0.1 ``` -------------------------------- ### TypeScript: Get Client Initialization Failure Behavior Source: https://www.statsig.com/trust/security Tests the SDK's behavior when the client initialization fails. This ensures proper error handling and reporting mechanisms are in place. ```typescript get-client-initialize-response-failure.test.ts ``` -------------------------------- ### Install Statsig JS Client for Web Analytics Source: https://www.statsig.com/trust/security Include the Statsig JavaScript client with web analytics and session replay capabilities in your HTML. Replace '' with your actual SDK key. ```HTML ``` -------------------------------- ### Go: Get Client Initialize Response Hashed SDK Key Entities Test Source: https://www.statsig.com/trust/security Tests the client initialization response in the Go SDK when filtering entities using a hashed SDK key. This verifies the correct application of hashing for entity filtering. ```go func TestGetClientInitializeResponseHashedSDKKeyEntities(t *testing.T) { // Test cases for client init response with hashed SDK key to entities filtering } ``` -------------------------------- ### Initialize Statsig SDK (Ruby) Source: https://www.statsig.com/trust/security Initializes the Statsig SDK in Ruby with a client SDK key. This step is required to integrate Statsig's feature flagging and A/B testing into your Ruby projects. ```ruby StatsigRuby.initialize("YOUR_CLIENT_SDK_KEY") ``` -------------------------------- ### Get Experiment Value (PHP) Source: https://www.statsig.com/trust/security Retrieves an experiment parameter's value in PHP. This function is used to get A/B test assignments for users. ```php $experiment = Statsig\Statsig::getExperiment("my_experiment"); $buttonColor = $experiment->getValue("button_color", "blue"); ``` -------------------------------- ### Diagnostics Initialization Success (TypeScript) Source: https://www.statsig.com/trust/security Validates the successful initialization of diagnostics. This test ensures that the diagnostics module starts correctly and is ready for monitoring. ```TypeScript diagnostics-init-success.test.ts ``` -------------------------------- ### Initialize Statsig SDK (Go) Source: https://www.statsig.com/trust/security Initializes the Statsig SDK in Go using a client SDK key. This function call is essential for activating Statsig services in your Go application. ```go statsig.Initialize("YOUR_CLIENT_SDK_KEY") ``` -------------------------------- ### Get Experiment Value (Java) Source: https://www.statsig.com/trust/security Retrieves an experiment parameter's value in Java. This function is used to get the assigned value for a user in an A/B test. ```java DynamicConfig experiment = Statsig.getExperiment(context, "my_experiment"); String buttonColor = experiment.getValue("button_color", "blue"); ``` -------------------------------- ### Go: Get Client Initialize Response Target App Test Source: https://www.statsig.com/trust/security Tests the client initialization response in the Go SDK when filtering target applications. This snippet focuses on the logic for applying target app filters. ```go func TestGetClientInitializeResponseTargetApp(t *testing.T) { // Test cases for client init response with target app filtering } ``` -------------------------------- ### Go: Get Client Initialize Response Hashed Target App Test Source: https://www.statsig.com/trust/security Tests the client initialization response in the Go SDK when filtering target applications using hashing. This snippet verifies hashing for target app filtering. ```go func TestGetClientInitializeResponseHashedTargetApp(t *testing.T) { // Test cases for client init response with hashed target app filtering } ``` -------------------------------- ### Test Cases for Bootstrapping Source: https://www.statsig.com/trust/security This snippet covers test cases related to the bootstrapping process for Anthropic LLMs. It includes tests for getting evaluations during bootstrapping and general bootstrapping scenarios, along with their inclusion status. ```JSON { "testFile": "get-evaluations-bootstrapping.test.ts", "testName": "Bootstraping Get Evaluations", "includedInTest": false }, { "testFile": "bootstrapping.test.ts", "testName": "Bootstraping", "includedInTest": true } ``` -------------------------------- ### Test Get Initial Response Source: https://www.statsig.com/trust/security Tests the retrieval of the initial client response. This TypeScript code verifies that the client can fetch and return its initial configuration or status. ```typescript import { expect, test } from "@jest/globals"; import { Client } from "../src/client"; test("Get Initial Response", async () => { const client = new Client({ apiKey: "key1" }); // Mocking a ``` -------------------------------- ### Install Statsig Ruby Gem Source: https://www.statsig.com/trust/security Add the Statsig Ruby gem to your project's Gemfile using the bundle add command. This integrates Statsig's features into your Ruby applications. ```Shell bundle add statsig ``` -------------------------------- ### Test Get Client Initialize Response with Hashed SDK Key Entities Source: https://www.statsig.com/trust/security Tests the client initialization response when it includes hashed SDK key entities, ensuring proper data handling. ```python import unittest from statsig import StatsigClient class TestGetClientInitializeResponseHashedSDKKeyEntities(unittest.TestCase): def test_hashed_sdk_key_entities(self): # Test logic for client initialization response with hashed SDK key entities pass if __name__ == '__main__': unittest.main() ``` -------------------------------- ### TypeScript: Test Diagnostics Init Success Source: https://www.statsig.com/trust/security Confirms the successful initialization of the diagnostics module. This test ensures that the diagnostics system can be started without errors. ```TypeScript { "testFile": "diagnostics-init-success.test.ts", "testName": "Diagnostics - Init Success", "includedInTest": true } ``` -------------------------------- ### Install Statsig Dart/Flutter SDK Source: https://www.statsig.com/trust/security Add the Statsig SDK to your Dart or Flutter project using the pub add command. This enables feature flagging for your cross-platform applications. ```Shell dart pub add statsig OR flutter pub add statsig ``` -------------------------------- ### TypeScript: Test Get Initialize Response Source: https://www.statsig.com/trust/security Verifies the response received after initializing the client. This test ensures that the initial connection and data retrieval are functioning as expected. ```TypeScript { "testFile": "get-init-response.test.ts", "testName": "Get Initialize Response", "includedInTest": false } ``` -------------------------------- ### Test Get Client Initialize Response V2 Source: https://www.statsig.com/trust/security Tests the V2 version of the client initialization response in the Statsig SDK. This covers updated protocols and data structures for initialization. ```TypeScript { "testFile": "get-client-initialize-response-v2.test.ts", "testName": "Get Client Initialize Response V2", "includedInTest": true } ``` -------------------------------- ### Test Cases for Get Layer Source: https://www.statsig.com/trust/security This snippet covers test cases related to retrieving layers in Anthropic LLMs. It includes comparisons between GetLayer and GetExperiment, layer exposure logging, and general layer functionality, all included in testing. ```JSON { "testFile": "get-layer-get-experiment.test.ts", "testName": "GetLayer vs GetExperiment", "includedInTest": true }, { "testFile": "layer-exposure.test.ts", "testName": "Layer Exposure Logging", "includedInTest": true }, { "testFile": "layer.test.ts", "testName": "Layers", "includedInTest": true } ``` -------------------------------- ### Test Get Evaluations - None Source: https://www.statsig.com/trust/security Tests the retrieval of evaluations without any hashing applied to configuration values. ```python import unittest from statsig import StatsigClient class TestGetEvaluationsNone(unittest.TestCase): def test_none_evaluations(self): # Test logic for evaluations with no hashing pass if __name__ == '__main__': unittest.main() ``` -------------------------------- ### Rust: Initialize Diagnostics Source: https://www.statsig.com/trust/security Tests the initialization of diagnostics for the Rust SDK. ```rust diagnostics-init.test.ts ``` ```rust diagnostics-get-client-initialize-response.test.ts ``` -------------------------------- ### Test Get Evaluations - DJB2 Source: https://www.statsig.com/trust/security Tests the retrieval of evaluations using DJB2 hashing for configuration values. ```python import unittest from statsig import StatsigClient class TestGetEvaluationsDJB2(unittest.TestCase): def test_djb2_evaluations(self): # Test logic for DJB2 evaluations pass if __name__ == '__main__': unittest.main() ``` -------------------------------- ### Initialize (C++ Client) Source: https://www.statsig.com/trust/security Tests the initialization process for the C++ client of Anthropic LLMs. This is a fundamental test to ensure the client can be set up correctly. ```C++ initialize.test.ts ``` -------------------------------- ### Python: Multi Server Instances Initialize Source: https://www.statsig.com/trust/security Tests the initialization of multiple server instances in the Python SDK. This snippet verifies the handling of concurrent or multiple SDK instances. ```Python { "testFile": "multi-instance-initialize.test.ts", "testName": "Multi Server Instances Initialize", "includedInTest": false } ``` -------------------------------- ### Python: Get Client Initialize Response with Target App Filtering Source: https://www.statsig.com/trust/security Tests the client initialization response with target application filtering in the Python server SDK. This verifies filtering based on application identifiers. ```Python { "testFile": "get-client-initialize-response-target-apps.test.ts", "testName": "Get Client Initialize Response with Target App Filtering", "includedInTest": true } ``` -------------------------------- ### Rust: Client Initialize Response - Standard Source: https://www.statsig.com/trust/security Tests the standard client initialization response for the Rust SDK. ```rust client-init-response.test.ts ``` -------------------------------- ### Rust: Get Evaluations - SHA256 Source: https://www.statsig.com/trust/security Tests retrieving evaluations using SHA256 hashing for the Rust SDK. ```rust get-evaluations.test.ts ``` -------------------------------- ### Get Client Initialize Response with Hashed Target App Filtering Source: https://www.statsig.com/trust/security Tests the client initialization response with filtering based on hashed target applications. This allows for more granular targeting. ```TypeScript get-client-initialize-response-hashed-target-apps.test.ts ``` -------------------------------- ### Get Client Initialize Response with Target App Filtering Source: https://www.statsig.com/trust/security Tests the client initialization response with filtering based on target applications. This is a standard method for application-specific feature delivery. ```TypeScript get-client-initialize-response-target-apps.test.ts ```