Closed afholderman closed 2 months ago
Our umd package should work with amd as well and I have verified this. The issue is if requirejs or amd is used, please use the named import rather than window.LDClient.
define(["jquery", "//unpkg.com/launchdarkly-js-client-sdk"], function (
$,
LDClient, // NOTE: use this named import instead of window.LDClient
) {
$(function () {
console.log(`window.LDClient is ${window.LDClient}.`);
console.log(`But LDClient should be defined: ${LDClient}`);
const client = LDClient.initialize("client-side-id", {
kind: "user",
key: "test-user-1",
});
client.waitForInitialization().then(function () {
console.log(`allFlags: ${JSON.stringify(client.allFlags(), null, " ")}`);
});
});
});
Requirements
Related issues
Provide links to any issues in this repository or elsewhere relating to this pull request.
Describe the solution you've provided
Provide a clear and concise description of what you expect to happen.
Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context about the pull request here.