Prerequisites
To complete this guide, you must have the following prerequisites:- Basic working knowledge of the LaunchDarkly JavaScript client-side SDK or React Web client-side SDK
- Basic working knowledge of Salesforce Lightning Web Components
Download the LaunchDarkly JavaScript Client
To begin, find the latest version under Releases in the JavaScript SDK GitHub repository. Then download the desired version fromhttps://unpkg.com/launchdarkly-js-client-sdk@<VERSION>/dist/ldclient.min.js.
Set up your Salesforce environment
Next, set up your Salesforce environment. To do this:- Upload the file to your Salesforce organization as a static resource in your org
- Enable Lightning Web Security in your org
- Add
https://*.launchdarkly.comas a CSP Trusted Site, under Manage CSP Trusted Sites
Using the LaunchDarkly client in a Lightning Web Component
In the JavaScript file of your Lightning Web Component, import the static resource:getter method:
Conclusion
In this guide, we discussed how to use the LaunchDarkly JavaScript and React Web client-side SDKs in Lightning Web Components. This allows you to leverage HTML, CSS, and JavaScript in a lightweight framework.Want to know more? Start a trial.Your 14-day trial begins as soon as you sign up. Get started in minutes using the in-app Quickstart. You’ll discover how easy it is to release, monitor, and optimize your software.
Want to try it out? Start a trial.
Want to try it out? Start a trial.