It only takes a few minutes to get started with LaunchDarkly and control your first feature flag.
The steps to integrate your application with LaunchDarkly are common across all SDKs:
Install the LaunchDarkly SDK as a dependency in your application using your project's dependency manager. Doing so will allow your application to access the LaunchDarkly SDK.
Import the LaunchDarkly client in your application code. This client is the primary way in which your application will use the SDK and communicate with LaunchDarkly.
Configure the LaunchDarkly client with your SDK key or Mobile key and create the client. Your SDK key or Mobile key uniquely identify your project and environment, and they authorize your application to connect to LaunchDarkly.
Given a particular feature flag key, check which variation a user should receive. Every feature flag is uniquely identified by a feature flag key. For every feature flag, each user will fall into one of the defined variations, from which your application code can respond accordingly.
You don't have to send users to LaunchDarkly in advance. You can target users before they have been populated on LaunchDarkly. Just set up your users in
variation calls and you're all set.
- Lastly, when your application is about to terminate, shut down the LaunchDarkly client. This ensures that the client releases any resources it is using, and that any pending analytics events are delivered to LaunchDarkly. If your application quits without this shutdown step, you may not see your requests and users on the dashboard, because they are derived from analytics events. This is something you only need to do once.
The exact semantics of each step, however, depend on the particulars of your SDK and technology. Continue on to the next section for more information.
Explore the following SDK reference guides for specific details about how to use LaunchDarkly with your tech stack.
Once you're ready to test your integration, head over to the debugger to get a real-time view of your feature flag requests as they're received.
To see the advanced configuration options available for your platform's SDK, see the Reference guides section.