Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This topic explains how to safely shut down different LaunchDarkly SDKs. This feature is available for client-side, server-side, and edge SDKs.Shut down the Launch
Darkly client LaunchDarkly SDKs provide language-specific methods to shut down their instances safely. In most applications, you do not have to manually shut down an SDK. LaunchDarkly SDKs automatically flush pending analytics events to LaunchDarkly at regular intervals. However, when your application is about to terminate, you should shut down the LaunchDarkly client. For most SDKs, this ensures that the client releases any resources it is using, and that it delivers any pending analytics to LaunchDarkly. If your application terminates without this shutdown step, flag evaluations and contexts or users may not appear on the Contexts list, because they are derived from analytics events. To learn more, read Analytics events. Do not attempt to evaluate flags or otherwise use the LaunchDarkly client after it has shut down, as doing so may result in undefined behavior. Shut down the client at a point in your application’s lifecycle where the client is no longer needed. Details about each SDK’s configuration are available in the SDK-specific sections below.Client-side SDKs
This feature is available in the following client-side SDKs:- .NET (client-side)
- Android
- C++ (client-side)
- Electron
- Flutter
- iOS
- JavaScript
- Node.js (client-side)
- React Native
.NET (client-side)
Expand .NET (client-side) code sample
Expand .NET (client-side) code sample
Android
Expand Android code sample
Expand Android code sample
C++ (client-side)
Expand C++ (client-side) code sample
Expand C++ (client-side) code sample
Electron
Expand Electron code sample
Expand Electron code sample
Flutter
Expand Flutter code sample
Expand Flutter code sample
iOS
Expand iOS code sample
Expand iOS code sample
Java
ScriptExpand JavaScript code sample
Expand JavaScript code sample
Node.js (client-side)
Expand Node.js (client-side) code sample
Expand Node.js (client-side) code sample
React Native
Expand React Native code sample
Expand React Native code sample
close flushes all queued events and shuts all open network connections.To shut down:close.Server-side SDKs
This feature is available in the following server-side SDKs:.NET (server-side)
Expand .NET (server-side) code sample
Expand .NET (server-side) code sample
C++ (server-side)
Expand C++ (server-side) code sample
Expand C++ (server-side) code sample
Erlang
Expand Erlang code sample
Expand Erlang code sample
stop_instance(), stop_instance(Tag), and stop_all_instances() all safely shut down client instances and release the resources associated with them.To shut down:Go
Expand Go code sample
Expand Go code sample
Haskell
Expand Haskell code sample
Expand Haskell code sample
Java
Expand Java code sample
Expand Java code sample
Close safely shuts down the client instance and releases all resources associated with the client.To shut down:Node.js (server-side)
Expand Node.js (server-side) code sample
Expand Node.js (server-side) code sample
Python
Expand Python code sample
Expand Python code sample
Ruby
Expand Ruby code sample
Expand Ruby code sample
Rust
Expand Rust code sample
Expand Rust code sample
Edge SDKs
This feature is available in the following edge SDKs:Cloudflare
Expand Cloudflare code sample
Expand Cloudflare code sample
close safely shuts down the client instance:Fastly
Expand Fastly code sample
Expand Fastly code sample
Vercel
Expand Vercel code sample
Expand Vercel code sample
close safely shuts down the client instance: