### Setup First Feature Flag with CLI Source: https://launchdarkly.com/docs/home/getting-started/ldcli Use the setup command for a guided walkthrough to create a flag, install an SDK, and toggle the flag. ```bash ldcli setup ``` -------------------------------- ### Clone Starting Point Repository Source: https://launchdarkly.com/docs/tutorials/ld4a-langgraph-migration Clone the starter repository and set up the environment by installing dependencies and copying the example environment file. ```bash git clone https://github.com/langchain-ai/react-agent cd react-agent uv sync cp .env.example .env ``` -------------------------------- ### Install and Run Python Sample App with OpenAI Observability Source: https://launchdarkly.com/docs/home/agentcontrol/agentcontrol-prompt.md Installs Python dependencies with observability support and runs the OpenAI example. This is the recommended setup for full observability. ```bash poetry install -E observability poetry run chat-observability-example ``` -------------------------------- ### Install Dependencies and Start Server Source: https://launchdarkly.com/docs/tutorials/observability-holiday-tracing Navigate to the project directory, install npm dependencies, and start the Node.js server. ```bash cd node-holiday-tracing npm install npm start ``` -------------------------------- ### Install Dependencies and Start Services Source: https://launchdarkly.com/docs/tutorials/otel-llm-practical-guide-with-langfuse Commands to install frontend dependencies, start the OTel Collector and Python backend using Docker Compose, and run the Expo development server. ```bash $| # Install frontend dependencies ---|--- npm install # Start the OTel Collector + Python backend docker compose up --build # In a separate terminal, start the Expo dev server npm run web ``` -------------------------------- ### Install and Run Python Sample App with LangChain Source: https://launchdarkly.com/docs/home/agentcontrol/agentcontrol-prompt.md Installs Python dependencies for LangChain multi-provider support and runs the LangChain example. ```bash poetry install -E langchain poetry run langchain-example ``` -------------------------------- ### Copy Example .env File Source: https://launchdarkly.com/docs/tutorials/otel-llm-practical-guide-with-langfuse Copy the example .env file to start configuring your project's environment variables. ```bash $| cp .env.example .env ---|--- ``` -------------------------------- ### Install and Run Python Sample App with Basic OpenAI Source: https://launchdarkly.com/docs/home/agentcontrol/agentcontrol-prompt.md Installs Python dependencies for basic OpenAI integration and runs the OpenAI example. ```bash poetry install -E openai poetry run openai-example ``` -------------------------------- ### Get Approval Request (PHP) Source: https://launchdarkly.com/docs/api/approvals/get-approval-for-flag Use GuzzleHttp in PHP to send a GET request to the LaunchDarkly API. This example assumes you have GuzzleHttp installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/projects/projectKey/flags/featureFlagKey/environments/environmentKey/approval-requests/id', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` -------------------------------- ### Get Branches using PHP GuzzleHttp Source: https://launchdarkly.com/docs/api/code-references/get-branches This PHP example uses the GuzzleHttp client to make a GET request to retrieve branches from LaunchDarkly. Ensure you have installed Guzzle via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/code-refs/repositories/repo/branches', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Setup and Initialization Commands Source: https://launchdarkly.com/docs/tutorials/offline-evals Commands to clone the repository, checkout the correct branch, set up environment variables, install dependencies, and initialize embeddings. Ensure API keys are added to the .env file. ```bash cd devrel-agents-tutorial git checkout feature/offline-evals cp .env.example .env # Add LD_SDK_KEY, LD_API_KEY, OPENAI_API_KEY, ANTHROPIC_API_KEY to .env uv sync (cd bootstrap && uv run python create_configs.py) uv run python initialize_embeddings.py ``` -------------------------------- ### Get Clientside MAU Usage with PHP Source: https://launchdarkly.com/docs/api/account-usage-beta/get-mau-clientside-usage This PHP example uses GuzzleHttp to make a GET request for clientside MAU usage data. It requires the GuzzleHttp library to be installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/usage/clientside-mau', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Setup Demo Project and Install Dependencies Source: https://launchdarkly.com/docs/tutorials/silent-failure-vega-ai-investigation Clone the repository, set up a Python virtual environment, and install necessary dependencies including the LaunchDarkly observability SDK. This prepares your project for instrumenting AI agents and sending data to LaunchDarkly. ```shell git clone https://github.com/arober39/ai-agent-order-history cd ai-agent-order-history python3 -m venv venv source venv/bin/activate pip install anthropic python-dotenv pip install launchdarkly-server-sdk launchdarkly-observability opentelemetry-api cat < .env ANTHROPIC_API_KEY=your-anthropic-key-here LD_SDK_KEY=your-launchdarkly-sdk-key-here EOF ``` -------------------------------- ### Generate Setup Script using Go HTTP Client Source: https://launchdarkly.com/docs/api/data-export-destinations/post-generate-warehouse-destination-setup-script Demonstrates how to use Go's standard http package to post data to the setup script endpoint. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.launchdarkly.com/api/v2/destinations/projects/projKey/environments/envKey/kinds/kind/setup" payload := strings.NewReader("{}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Swift SDK: Get Observability Metrics Usage Source: https://launchdarkly.com/docs/api/account-usage-beta/get-observability-metrics-usage Use Foundation's URLSession in Swift to make a GET request for observability metrics usage. This example configures the request and starts the data task. ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://app.launchdarkly.com/api/v2/usage/observability/metrics")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Initialize SDK with Context and Plugins Array (Alternative) Source: https://launchdarkly.com/docs/sdk/observability/javascript Initialize the SDK with a user context and a plugins array, similar to a previous example but presented as an alternative. Includes observability and session replay configurations. ```javascript // You'll need this context later, but you can ignore it for now. const context = { kind: 'user', key: 'example-context-key' }; const client = initialize('example-client-side-id', context, { plugins: [ new Observability({ tracingOrigins: true, // attribute frontend requests to backend domains networkRecording: { enabled: true, recordHeadersAndBody: true } }), new SessionReplay({ privacySetting: 'strict', // or 'default' to redact text matching common regex for PII // or 'none' to turn off obfuscation }) ] }); ``` -------------------------------- ### Set Up Virtual Environment and Install Dependencies Source: https://launchdarkly.com/docs/tutorials/python-flask-websockets-kill-switch-flags Create a virtual environment, activate it, and install the necessary Python packages including the LaunchDarkly SDK, python-dotenv, Flask, and requests. ```bash python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate (venv) $ pip install launchdarkly-server-sdk-ai python-dotenv flask requests (venv) $ python3 app.py ``` -------------------------------- ### Python SDK Example Source: https://launchdarkly.com/docs/api/code-references/get-extinctions Use the Python requests library to make a GET request to the extinctions endpoint. Ensure you have the requests library installed. ```python import requests url = "https://app.launchdarkly.com/api/v2/code-refs/extinctions" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` -------------------------------- ### Get Public IP List (PHP) Source: https://launchdarkly.com/docs/api/other/get-ips Use GuzzleHttp to make a GET request for the public IP list in PHP. This example assumes you have GuzzleHttp installed via Composer. Replace '' with your LaunchDarkly API key. ```php request('GET', 'https://app.launchdarkly.com/api/v2/public-ip-list', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Initialize Client (Objective-C) Source: https://launchdarkly.com/docs/sdk/client-side/ios Configure the SDK with a mobile key and initialize the client using Objective-C. This example demonstrates setting up context with kind, name, and building the context. ```objectivec LDConfig *config = [[LDConfig alloc] initWithMobileKey:@"example-mobile-key" autoEnvAttributes:AutoEnvAttributesEnabled]; // You'll need this context later, but you can ignore it for now. LDContextBuilder *builder = [[LDContextBuilder alloc] initWithKey:@"example-context-key"]; [builder kindWithKind:@"user"]; [builder nameWithName:@"Sandy"]; ContextBuilderResult *result = [builder build]; [LDClient startWithConfiguration:config context:context startWaitSeconds:5.0 completion:^(BOOL timedOut) { if(timedOut) { // Client may not have the most recent flags for the configured context } else { // Client has received flags for the configured context } }]; ``` -------------------------------- ### Get Experiments (PHP) Source: https://launchdarkly.com/docs/api/experiments/get-experiments A PHP example using Guzzle HTTP client to fetch experiments. It requires the Guzzle library to be installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/projects/projectKey/environments/environmentKey/experiments', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Generate Setup Script using Ruby Net::HTTP Source: https://launchdarkly.com/docs/api/data-export-destinations/post-generate-warehouse-destination-setup-script This Ruby example shows how to construct and send a POST request using Net::HTTP. ```ruby require 'uri' require 'net/http' url = URI("https://app.launchdarkly.com/api/v2/destinations/projects/projKey/environments/envKey/kinds/kind/setup") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` -------------------------------- ### Get Approval Requests (PHP) Source: https://launchdarkly.com/docs/api/approvals/get-approvals-for-flag A PHP example using GuzzleHttp to fetch approval requests. This requires the GuzzleHttp library to be installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/projects/projectKey/flags/featureFlagKey/environments/environmentKey/approval-requests', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Resource Configuration Example Source: https://launchdarkly.com/docs/guides/account/large-teams An example of how to configure resources for a project, specifying environments and flags. ```json { "resources": ["proj/ecommerce:env/production:flag/*"] } ] ``` -------------------------------- ### Get Applications with PHP Guzzle Source: https://launchdarkly.com/docs/api/applications-beta/get-applications This PHP example uses the Guzzle HTTP client to fetch applications. Ensure you have installed Guzzle via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/applications', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Example SDK Setup for Android (Java) Source: https://launchdarkly.com/docs/guides/flags/defining-mobile-apps Configure the SDK with basic application information including ID, name, and version. This setup is used to capture details about the application and device for targeting purposes. ```java LDConfig config = new LDConfig.Builder(AutoEnvAttributes.Enabled) .applicationInfo( Components.applicationInfo() .applicationId("ghs-android-app") .applicationName("Global-Health-Services-App-for-Doctors") .applicationVersion("1.0.0") .applicationVersionName("v1") ) .build(); ``` -------------------------------- ### Get Dependent Flags (PHP) Source: https://launchdarkly.com/docs/api/feature-flags-beta/get-dependent-flags-by-env A PHP example using Guzzle HTTP client to retrieve dependent flags. This requires the Guzzle library to be installed via Composer. It demonstrates setting the GET request, headers, and echoing the response body. ```php request('GET', 'https://app.launchdarkly.com/api/v2/flags/projectKey/environmentKey/featureFlagKey/dependent-flags', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Get Root Statistic with PHP Guzzle Source: https://launchdarkly.com/docs/api/code-references/get-root-statistic This PHP example uses the Guzzle HTTP client to fetch root statistics. Ensure you have Guzzle installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/code-refs/statistics', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` -------------------------------- ### Configure Environment Variables Source: https://launchdarkly.com/docs/tutorials/data-extraction-pipeline Copy the example environment file and populate it with your LaunchDarkly SDK key and other necessary credentials for bootstrapping. ```bash # 1. Configure environment variables cp .env.example .env # Add your keys to .env: # LAUNCHDARKLY_SDK_KEY=sdk-xxxxx # LD_API_KEY=api-xxxxx (for bootstrap only) # LD_PROJECT_KEY=your-project (for bootstrap only) ``` -------------------------------- ### Get SDK Versions Usage (PHP) Source: https://launchdarkly.com/docs/api/account-usage-beta/get-stream-usage-sdkversion Employ the Guzzle HTTP client for PHP to send a GET request to the SDK versions usage endpoint. This example assumes you have Guzzle installed via Composer. Replace `` with your LaunchDarkly API key. ```php request('GET', 'https://app.launchdarkly.com/api/v2/usage/streams/source/sdkversions', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Complete Warehouse Destination Setup (Go) Source: https://launchdarkly.com/docs/api/data-export-destinations/post-complete-warehouse-destination-setup A Go program to complete warehouse destination setup. This example uses the standard 'net/http' package. Remember to replace the placeholder values for project key, environment key, and API key. ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://app.launchdarkly.com/api/v2/destinations/projects/projKey/environments/envKey/kinds/kind/complete-setup" payload := strings.NewReader("{}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Initialize Client with LDUser and startFuture Source: https://launchdarkly.com/docs/sdk/client-side/flutter This example demonstrates initializing the client with a specific user and then using `startFuture` with a timeout. It configures the client with a mobile key, creates a user with an email, and ensures feature flags are loaded within the time limit. ```dart LDConfig config = LDConfigBuilder('example-mobile-key').build(); LDUser user = LDUserBuilder('example-user-key') .email('sandy@example.com') .build(); await LDClient.start(config, user); await LDClient.startFuture(timeLimit: Duration(seconds: 5)); ``` -------------------------------- ### Get Workflows with PHP (Guzzle) Source: https://launchdarkly.com/docs/api/workflows/get-workflows This PHP example utilizes the Guzzle HTTP client to fetch workflows. It configures the GET request with the necessary Authorization header and echoes the response body. Ensure you have Guzzle installed via Composer and replace the placeholder values. ```php request('GET', 'https://app.launchdarkly.com/api/v2/projects/projectKey/flags/featureFlagKey/environments/environmentKey/workflows', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Initialize C/C++ SDK v3 Client Source: https://launchdarkly.com/docs/sdk/client-side/c-c--/migration-2-to-3 Demonstrates the v3.0 approach for initializing the client using `ContextBuilder` and `Client`. ```cpp auto context = ContextBuilder().Kind("user", "example-user-key").Build(); client_side::Client client(config, context); client.StartAsync().wait_for(std::chrono::seconds(10)); ``` -------------------------------- ### Get Total Contexts Usage (PHP) Source: https://launchdarkly.com/docs/api/account-usage-beta/get-contexts-total-usage A PHP example using Guzzle HTTP client to retrieve total contexts usage. Ensure you have Guzzle installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/usage/total-contexts', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Configure Plugins with manualStart: true Source: https://launchdarkly.com/docs/sdk/observability/javascript Configure both observability and session replay plugins with `manualStart: true` when initializing the SDK client. This prepares them for manual starting. ```javascript const client = initialize('example-client-side-id', { observability: { manualStart: true /* other observability plugin options here */ }, sessionReplay: { manualStart: true /* other session replay plugin options here */ } }); ``` -------------------------------- ### Get Data Export Destinations (PHP) Source: https://launchdarkly.com/docs/api/data-export-destinations/get-destinations This PHP example uses GuzzleHttp to fetch data export destinations. Make sure to install Guzzle via Composer and include the autoloader. ```php request('GET', 'https://app.launchdarkly.com/api/v2/destinations', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Get Evaluations Usage (PHP) Source: https://launchdarkly.com/docs/api/account-usage-beta/get-evaluations-usage This PHP example uses the Guzzle HTTP client to fetch evaluations usage data. Make sure to install Guzzle via Composer. Replace `` with your credentials. ```php request('GET', 'https://app.launchdarkly.com/api/v2/usage/evaluations/projectKey/environmentKey/featureFlagKey', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Standard Data System Setup (Go) Source: https://launchdarkly.com/docs/sdk/features/data-saving-mode Configure the Go SDK with the default data system, which uses streaming and polling for initialization, real-time updates, and redundancy. ```go import ( "github.com/launchdarkly/go-sdk-common/v3/ldcontext" ld "github.com/launchdarkly/go-server-sdk/v7" "github.com/launchdarkly/go-server-sdk/v7/ldcomponents" ) var config ld.Config config.DataSystem = ldcomponents.DataSystem().Default() client, _ := ld.MakeCustomClient("YOUR_SDK_KEY", config, 5*time.Second) ``` -------------------------------- ### Initialize SDK and Plugins Separately with manualStart: true Source: https://launchdarkly.com/docs/sdk/observability/react-web Configure the observability and session replay plugins with `manualStart: true` when initializing the SDK. This defers the actual start of data collection until explicitly called. ```javascript const LDProvider = createLDReactProvider( 'example-client-side-id', { kind: 'user', key: 'example-context-key' }, { ldOptions: { plugins: [ new Observability({ manualStart: true }), new SessionReplay({ manualStart: true }) ] } } ); ``` ```javascript const LDProvider = withLDProvider({ clientSideID: 'example-client-side-id', context, options: { plugins: [ new Observability({ manualStart: true }), new SessionReplay({ manualStart: true }) ] } })(App); ``` -------------------------------- ### Configure Highlight Go SDK Source: https://launchdarkly.com/docs/tutorials/tracing-distributed-systems-in-nextjs Initialize the Highlight Go SDK with your project ID and service details. Ensure `highlight.Stop()` is deferred to properly flush traces. ```go import ( "github.com/highlight/highlight/sdk/highlight-go" ) func main() { // ... highlight.SetProjectID("") highlight.Start( highlight.WithServiceName("my-app"), highlight.WithServiceVersion("git-sha"), ) defer highlight.Stop() // ... } ``` -------------------------------- ### Get Context Instances (PHP) Source: https://launchdarkly.com/docs/api/contexts/get-context-instances This PHP example uses the Guzzle HTTP client to fetch context instances. It sets the authorization header and echoes the response body. Ensure you have Guzzle installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/projects/projectKey/environments/environmentKey/context-instances/id', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Clone the Starter Project Source: https://launchdarkly.com/docs/tutorials/collect-qualitative-user-feedback-homepage Clone the provided starter project to follow along with the tutorial. This project includes a sample app for implementing user feedback. ```bash git clone git@github.com:launchdarkly-labs/ld-feedback-tutorial.git ``` -------------------------------- ### Get Observability Traces Usage (PHP) Source: https://launchdarkly.com/docs/api/account-usage-beta/get-observability-traces-usage This PHP example utilizes the Guzzle HTTP client to retrieve observability traces usage. Ensure you have Guzzle installed via Composer and replace '' with your API key. ```php request('GET', 'https://app.launchdarkly.com/api/v2/usage/observability/traces', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Get MAU SDKs by Type (PHP) Source: https://launchdarkly.com/docs/api/account-usage-beta/get-mau-sdks-by-type This PHP example uses Guzzle HTTP client to retrieve MAU SDK usage data from the LaunchDarkly API. Make sure Guzzle is installed via Composer. ```php request('GET', 'https://app.launchdarkly.com/api/v2/usage/mau/sdks', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Basic Ruby Logging Setup Source: https://launchdarkly.com/docs/tutorials/5-best-ruby-logging-libraries Demonstrates basic logger instantiation, adding a stdout appender, and logging messages at different levels. ```ruby require 'logging' logger = Logging.logger['example_logger'] logger.add_appenders(Logging.appenders.stdout) logger.debug("This a debug message.") logger.info("This is an info message.") logger.warn("This is a warning message.") logger.error("This is an error message.") logger.fatal("This is a fatal message.") ``` -------------------------------- ### Get Server-Side Context Usage (PHP) Source: https://launchdarkly.com/docs/api/account-usage-beta/get-contexts-serverside-usage A PHP example using Guzzle HTTP client to fetch server-side contexts usage data. Make sure to install Guzzle via Composer and replace `` with your key. ```php request('GET', 'https://app.launchdarkly.com/api/v2/usage/serverside-contexts', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Initialize Client with Observability (Swift) Source: https://launchdarkly.com/docs/sdk/client-side/ios Configure the SDK with a mobile key, enable auto environment attributes, and optionally add an observability plugin for debugging and metrics. This example uses Swift and is recommended for SDK versions 9.14+. ```swift let config = LDConfig(mobileKey: "example-mobile-key", autoEnvAttributes: .enabled) // optional observability plugin, requires iOS SDK v9.14+ config.plugins = [ Observability( options: .init( resourceAttributes: [ "my-attribute": .string("new-value") ], isDebug: true, logs: .enabled, traces: .enabled, metrics: .enabled ) ) ] // You'll need this context later, but you can ignore it for now. let contextBuilder = LDContextBuilder(key: "example-context-key") guard case .success(let context) = contextBuilder.build() else { return } LDClient.start(config: config, context: context, startWaitSeconds: 5) { timedOut in if timedOut { // Client may not have the most recent flags for the configured context } else { // Client has received flags for the configured context } } ``` -------------------------------- ### Get All Holdouts (PHP) Source: https://launchdarkly.com/docs/api/holdouts/get-all-holdouts Using Guzzle HTTP client in PHP to fetch holdouts. This example requires the Guzzle library to be installed via Composer. Remember to replace the placeholder values with your specific project, environment, and API key. ```php request('GET', 'https://app.launchdarkly.com/api/v2/projects/projectKey/environments/environmentKey/holdouts', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ?> ``` -------------------------------- ### Initialize Client with startFuture and Timeout Source: https://launchdarkly.com/docs/sdk/client-side/flutter This example demonstrates initializing the client using `start` and then using `startFuture` with a timeout. This is useful for ensuring the SDK receives feature flag values within a specified time limit, especially in older SDK versions. ```dart LDConfig config = LDConfigBuilder('example-mobile-key', AutoEnvAttributes.Enabled) .build(); LDContextBuilder builder = LDContextBuilder(); builder.kind('user', 'example-user-key'); LDContext context = builder.build(); await LDClient.start(config, context); await LDClient.startFuture(timeLimit: Duration(seconds: 5)); ``` -------------------------------- ### Install Dependencies and Run Dev Server Source: https://launchdarkly.com/docs/tutorials/collect-qualitative-user-feedback-homepage Install project dependencies using npm and start the development server to view your application. This step is crucial for testing the implemented feedback function. ```bash npm i npm run dev ```