launchdarkly-js-sdk-common 3.3.2 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/ldclient-common.cjs.js +1 -1
- package/dist/ldclient-common.cjs.js.map +1 -1
- package/dist/ldclient-common.es.js +1 -1
- package/dist/ldclient-common.es.js.map +1 -1
- package/dist/ldclient-common.min.js +1 -1
- package/dist/ldclient-common.min.js.map +1 -1
- package/package.json +2 -2
- package/typings.d.ts +28 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "launchdarkly-js-sdk-common",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.3",
|
|
4
4
|
"description": "LaunchDarkly SDK for JavaScript - common code",
|
|
5
5
|
"author": "LaunchDarkly <team@launchdarkly.com>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"base64-js": "^1.3.0",
|
|
75
75
|
"fast-deep-equal": "^2.0.1",
|
|
76
|
-
"uuid": "^
|
|
76
|
+
"uuid": "^8.0.0"
|
|
77
77
|
},
|
|
78
78
|
"repository": {
|
|
79
79
|
"type": "git",
|
package/typings.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
80
80
|
* immediately after calling `initialize()` (normally they would not be available until the
|
|
81
81
|
* client signals that it is ready).
|
|
82
82
|
*
|
|
83
|
-
* For more information, see the [SDK Reference Guide](https://docs.launchdarkly.com/
|
|
83
|
+
* For more information, see the [SDK Reference Guide](https://docs.launchdarkly.com/sdk/features/bootstrapping#javascript).
|
|
84
84
|
*/
|
|
85
85
|
bootstrap?: 'localStorage' | LDFlagSet;
|
|
86
86
|
|
|
@@ -153,7 +153,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
153
153
|
* Whether to send analytics events back to LaunchDarkly. By default, this is true.
|
|
154
154
|
*/
|
|
155
155
|
sendEvents?: boolean;
|
|
156
|
-
|
|
156
|
+
|
|
157
157
|
/**
|
|
158
158
|
* Whether all user attributes (except the user key) should be marked as private, and
|
|
159
159
|
* not sent to LaunchDarkly in analytics events.
|
|
@@ -195,14 +195,14 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* The capacity of the analytics events queue.
|
|
198
|
-
*
|
|
198
|
+
*
|
|
199
199
|
* The client buffers up to this many events in memory before flushing. If the capacity is exceeded
|
|
200
200
|
* before the queue is flushed, events will be discarded. Increasing the capacity means that events
|
|
201
201
|
* are less likely to be discarded, at the cost of consuming more memory. Note that in regular usage
|
|
202
202
|
* flag evaluations do not produce individual events, only summary counts, so you only need a large
|
|
203
203
|
* capacity if you are generating a large number of click, pageview, or identify events (or if you
|
|
204
204
|
* are using the event debugger).
|
|
205
|
-
*
|
|
205
|
+
*
|
|
206
206
|
* The default value is 100.
|
|
207
207
|
*/
|
|
208
208
|
eventCapacity?: number;
|
|
@@ -236,7 +236,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
238
|
* Set to true to opt out of sending diagnostics data.
|
|
239
|
-
*
|
|
239
|
+
*
|
|
240
240
|
* Unless `diagnosticOptOut` is set to true, the client will send some diagnostics data to the LaunchDarkly
|
|
241
241
|
* servers in order to assist in the development of future SDK improvements. These diagnostics consist of
|
|
242
242
|
* an initial payload containing some details of SDK in use, the SDK's configuration, and the platform the
|
|
@@ -244,10 +244,10 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
244
244
|
* as dropped events.
|
|
245
245
|
*/
|
|
246
246
|
diagnosticOptOut?: boolean;
|
|
247
|
-
|
|
247
|
+
|
|
248
248
|
/**
|
|
249
249
|
* The interval at which periodic diagnostic data is sent, in milliseconds.
|
|
250
|
-
*
|
|
250
|
+
*
|
|
251
251
|
* The default is 900000 (every 15 minutes) and the minimum value is 6000. See [[diagnosticOptOut]]
|
|
252
252
|
* for more information on the diagnostics data being sent.
|
|
253
253
|
*/
|
|
@@ -271,7 +271,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
271
271
|
/**
|
|
272
272
|
* Whether to disable the automatic sending of an alias event when [[identify]] is
|
|
273
273
|
* called with a non-anonymous user when the previous user is anonymous.
|
|
274
|
-
*
|
|
274
|
+
*
|
|
275
275
|
* The default value is `false`.
|
|
276
276
|
*/
|
|
277
277
|
autoAliasingOptOut?: boolean;
|
|
@@ -295,7 +295,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
295
295
|
|
|
296
296
|
/**
|
|
297
297
|
* An optional secondary key for a user. This affects
|
|
298
|
-
* [feature flag targeting](https://docs.launchdarkly.com/
|
|
298
|
+
* [feature flag targeting](https://docs.launchdarkly.com/home/flags/targeting-users#targeting-rules-based-on-user-attributes)
|
|
299
299
|
* as follows: if you have chosen to bucket users by a specific attribute, the secondary key (if set)
|
|
300
300
|
* is used to further distinguish between users who are otherwise identical according to that attribute.
|
|
301
301
|
*/
|
|
@@ -365,9 +365,9 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
365
365
|
/**
|
|
366
366
|
* Describes the reason that a flag evaluation produced a particular value. This is
|
|
367
367
|
* part of the [[LDEvaluationDetail]] object returned by [[LDClient.variationDetail]].
|
|
368
|
-
*
|
|
369
|
-
* This type is separate from `[[LDEvaluationReason]]` for backwards compatibility. In
|
|
370
|
-
* earlier versions of this SDK, `[[LDEvaluationReason]]` was incorrectly defined as
|
|
368
|
+
*
|
|
369
|
+
* This type is separate from `[[LDEvaluationReason]]` for backwards compatibility. In
|
|
370
|
+
* earlier versions of this SDK, `[[LDEvaluationReason]]` was incorrectly defined as
|
|
371
371
|
* being non-nullable.
|
|
372
372
|
*/
|
|
373
373
|
interface NonNullableLDEvaluationReason {
|
|
@@ -409,7 +409,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
409
409
|
/**
|
|
410
410
|
* Describes the reason that a flag evaluation produced a particular value. This is
|
|
411
411
|
* part of the [[LDEvaluationDetail]] object returned by [[LDClient.variationDetail]].
|
|
412
|
-
*
|
|
412
|
+
*
|
|
413
413
|
* Will be null when `[[LDOptions.evaluationReasons]]` is `false`.
|
|
414
414
|
*/
|
|
415
415
|
export type LDEvaluationReason = NonNullableLDEvaluationReason | null;
|
|
@@ -420,7 +420,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
420
420
|
*
|
|
421
421
|
* This is the result of calling [[LDClient.variationDetail]].
|
|
422
422
|
*
|
|
423
|
-
* For more information, see the [SDK reference guide](https://docs.launchdarkly.com/
|
|
423
|
+
* For more information, see the [SDK reference guide](https://docs.launchdarkly.com/sdk/features/evaluation-reasons#javascript).
|
|
424
424
|
*/
|
|
425
425
|
export interface LDEvaluationDetail {
|
|
426
426
|
/**
|
|
@@ -445,7 +445,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
445
445
|
* The basic interface for the LaunchDarkly client. The browser SDK and the Electron SDK both
|
|
446
446
|
* use this, but may add some methods of their own.
|
|
447
447
|
*
|
|
448
|
-
* @see
|
|
448
|
+
* @see https://docs.launchdarkly.com/sdk/client-side/javascript
|
|
449
449
|
*
|
|
450
450
|
* @ignore (don't need to show this separately in TypeDoc output; all methods will be shown in LDClient)
|
|
451
451
|
*/
|
|
@@ -470,10 +470,10 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
470
470
|
*
|
|
471
471
|
* If you want to distinguish between these success and failure conditions, use
|
|
472
472
|
* [[waitForInitialization]] instead.
|
|
473
|
-
*
|
|
473
|
+
*
|
|
474
474
|
* If you prefer to use event listeners ([[on]]) rather than Promises, you can listen on the
|
|
475
475
|
* client for a `"ready"` event, which will be fired in either case.
|
|
476
|
-
*
|
|
476
|
+
*
|
|
477
477
|
* @returns
|
|
478
478
|
* A Promise that will be resolved once the client is no longer trying to initialize.
|
|
479
479
|
*/
|
|
@@ -498,7 +498,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
498
498
|
* await client.waitForInitialization();
|
|
499
499
|
* doSomethingWithSuccessfullyInitializedClient();
|
|
500
500
|
* } catch (err) {
|
|
501
|
-
* doSomethingForFailedStartup(err);
|
|
501
|
+
* doSomethingForFailedStartup(err);
|
|
502
502
|
* }
|
|
503
503
|
* ```
|
|
504
504
|
*
|
|
@@ -509,7 +509,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
509
509
|
*
|
|
510
510
|
* Note that you can also use event listeners ([[on]]) for the same purpose: the event `"initialized"`
|
|
511
511
|
* indicates success, and `"failed"` indicates failure.
|
|
512
|
-
*
|
|
512
|
+
*
|
|
513
513
|
* @returns
|
|
514
514
|
* A Promise that will be resolved if the client initializes successfully, or rejected if it
|
|
515
515
|
* fails.
|
|
@@ -530,7 +530,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
530
530
|
* @param user
|
|
531
531
|
* The user properties. Must contain at least the `key` property.
|
|
532
532
|
* @param hash
|
|
533
|
-
* The signed user key if you are using [Secure Mode](
|
|
533
|
+
* The signed user key if you are using [Secure Mode](https://docs.launchdarkly.com/sdk/features/secure-mode#configuring-secure-mode-in-the-javascript-client-side-sdk).
|
|
534
534
|
* @param onDone
|
|
535
535
|
* A function which will be called as soon as the flag values for the new user are available,
|
|
536
536
|
* with two parameters: an error value (if any), and an [[LDFlagSet]] containing the new values
|
|
@@ -593,7 +593,7 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
593
593
|
* The `reason` property of the result will also be included in analytics events, if you are
|
|
594
594
|
* capturing detailed event data for this flag.
|
|
595
595
|
*
|
|
596
|
-
* For more information, see the [SDK reference guide](https://docs.launchdarkly.com/
|
|
596
|
+
* For more information, see the [SDK reference guide](https://docs.launchdarkly.com/sdk/features/evaluation-reasons#javascript).
|
|
597
597
|
*
|
|
598
598
|
* @param key
|
|
599
599
|
* The unique key of the feature flag.
|
|
@@ -688,16 +688,16 @@ declare module 'launchdarkly-js-sdk-common' {
|
|
|
688
688
|
track(key: string, data?: any, metricValue?: number): void;
|
|
689
689
|
|
|
690
690
|
/**
|
|
691
|
-
* Associates two users for analytics purposes.
|
|
692
|
-
*
|
|
693
|
-
* This can be helpful in the situation where a person is represented by multiple
|
|
694
|
-
* LaunchDarkly users. This may happen, for example, when a person initially logs into
|
|
691
|
+
* Associates two users for analytics purposes.
|
|
692
|
+
*
|
|
693
|
+
* This can be helpful in the situation where a person is represented by multiple
|
|
694
|
+
* LaunchDarkly users. This may happen, for example, when a person initially logs into
|
|
695
695
|
* an application-- the person might be represented by an anonymous user prior to logging
|
|
696
696
|
* in and a different user after logging in, as denoted by a different user key.
|
|
697
|
-
*
|
|
698
|
-
* @param user
|
|
697
|
+
*
|
|
698
|
+
* @param user
|
|
699
699
|
* The newly identified user.
|
|
700
|
-
* @param previousUser
|
|
700
|
+
* @param previousUser
|
|
701
701
|
* The previously identified user.
|
|
702
702
|
*/
|
|
703
703
|
alias(user: LDUser, previousUser: LDUser): void;
|