@launchdarkly/js-client-sdk 0.5.3 → 0.7.0
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/CHANGELOG.md +33 -0
- package/dist/{common-DPjctgS7.d.cts → common-Duna6UXR.d.cts} +57 -45
- package/dist/{common-DPjctgS7.d.ts → common-Duna6UXR.d.ts} +57 -45
- package/dist/compat.cjs +1 -1
- package/dist/compat.cjs.map +1 -1
- package/dist/compat.d.cts +3 -3
- package/dist/compat.d.ts +3 -3
- package/dist/compat.js +1 -1
- package/dist/compat.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.7.0](https://github.com/launchdarkly/js-core/compare/js-client-sdk-v0.6.0...js-client-sdk-v0.7.0) (2025-05-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* Add support for per-context summary events. ([#859](https://github.com/launchdarkly/js-core/issues/859)) ([c9fa5c4](https://github.com/launchdarkly/js-core/commit/c9fa5c45f3ac2cbaad2f2e6312d5231c3f671d98))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @launchdarkly/js-client-sdk-common bumped from 1.13.0 to 1.14.0
|
|
16
|
+
|
|
17
|
+
## [0.6.0](https://github.com/launchdarkly/js-core/compare/js-client-sdk-v0.5.3...js-client-sdk-v0.6.0) (2025-04-29)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* Add client-side SDK plugin support. ([#834](https://github.com/launchdarkly/js-core/issues/834)) ([a843a33](https://github.com/launchdarkly/js-core/commit/a843a33e97dcab706a0034bd1fd1e3d2f78a9262))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* Client SDKs should use wrapper information. ([#836](https://github.com/launchdarkly/js-core/issues/836)) ([1e0cf6a](https://github.com/launchdarkly/js-core/commit/1e0cf6a0f77f8cfe6a7a0e675fc6490ea52a5b07))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Dependencies
|
|
31
|
+
|
|
32
|
+
* The following workspace dependencies were updated
|
|
33
|
+
* dependencies
|
|
34
|
+
* @launchdarkly/js-client-sdk-common bumped from 1.12.6 to 1.13.0
|
|
35
|
+
|
|
3
36
|
## [0.5.3](https://github.com/launchdarkly/js-core/compare/js-client-sdk-v0.5.2...js-client-sdk-v0.5.3) (2025-04-16)
|
|
4
37
|
|
|
5
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LDIdentifyOptions,
|
|
1
|
+
import { LDIdentifyOptions, LDClient as LDClient$1, LDContext, LDPluginBase, Hook, LDOptions, BasicLoggerOptions, LDLogger } from '@launchdarkly/js-client-sdk-common';
|
|
2
2
|
|
|
3
3
|
interface BrowserIdentifyOptions extends Omit<LDIdentifyOptions, 'waitForNetworkResults'> {
|
|
4
4
|
/**
|
|
@@ -22,49 +22,6 @@ interface BrowserIdentifyOptions extends Omit<LDIdentifyOptions, 'waitForNetwork
|
|
|
22
22
|
bootstrap?: unknown;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Initialization options for the LaunchDarkly browser SDK.
|
|
27
|
-
*/
|
|
28
|
-
interface BrowserOptions extends Omit<LDOptions, 'initialConnectionMode'> {
|
|
29
|
-
/**
|
|
30
|
-
* Whether the client should make a request to LaunchDarkly for Experimentation metrics (goals).
|
|
31
|
-
*
|
|
32
|
-
* This is true by default, meaning that this request will be made on every page load.
|
|
33
|
-
* Set it to false if you are not using Experimentation and want to skip the request.
|
|
34
|
-
*/
|
|
35
|
-
fetchGoals?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* A function which, if present, can change the URL in analytics events to something other
|
|
38
|
-
* than the actual browser URL. It will be called with the current browser URL as a parameter,
|
|
39
|
-
* and returns the value that should be stored in the event's `url` property.
|
|
40
|
-
*
|
|
41
|
-
* It may be useful to customize the `url` to provide specific meaning, incorporate
|
|
42
|
-
* client-side routing concerns, or redact tokens or other info.
|
|
43
|
-
*/
|
|
44
|
-
eventUrlTransformer?: (url: string) => string;
|
|
45
|
-
/**
|
|
46
|
-
* Whether or not to open a streaming connection to LaunchDarkly for live flag updates.
|
|
47
|
-
*
|
|
48
|
-
* If this is true, the client will always attempt to maintain a streaming connection; if false,
|
|
49
|
-
* it never will. If you leave the value undefined (the default), the client will open a streaming
|
|
50
|
-
* connection if you subscribe to `"change"` or `"change:flag-key"` events.
|
|
51
|
-
*
|
|
52
|
-
* This is equivalent to calling `client.setStreaming()` with the same value.
|
|
53
|
-
*/
|
|
54
|
-
streaming?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Determines if the SDK responds to entering different visibility states, such as foreground and background.
|
|
57
|
-
* An example is flushing buffered events when going to the background.
|
|
58
|
-
*
|
|
59
|
-
* This is true by default. Generally speaking the SDK will be able to most reliably deliver
|
|
60
|
-
* events with this setting on.
|
|
61
|
-
*
|
|
62
|
-
* It may be useful to disable for environments where not all window/document objects are
|
|
63
|
-
* available, such as when running the SDK in a browser extension.
|
|
64
|
-
*/
|
|
65
|
-
automaticBackgroundHandling?: boolean;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
25
|
/**
|
|
69
26
|
*
|
|
70
27
|
* The LaunchDarkly SDK client object.
|
|
@@ -121,6 +78,61 @@ type LDClient = Omit<LDClient$1, 'setConnectionMode' | 'getConnectionMode' | 'ge
|
|
|
121
78
|
identify(context: LDContext, identifyOptions?: BrowserIdentifyOptions): Promise<void>;
|
|
122
79
|
};
|
|
123
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Interface for plugins to the LaunchDarkly SDK.
|
|
83
|
+
*/
|
|
84
|
+
interface LDPlugin extends LDPluginBase<LDClient, Hook> {
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Initialization options for the LaunchDarkly browser SDK.
|
|
89
|
+
*/
|
|
90
|
+
interface BrowserOptions extends Omit<LDOptions, 'initialConnectionMode'> {
|
|
91
|
+
/**
|
|
92
|
+
* Whether the client should make a request to LaunchDarkly for Experimentation metrics (goals).
|
|
93
|
+
*
|
|
94
|
+
* This is true by default, meaning that this request will be made on every page load.
|
|
95
|
+
* Set it to false if you are not using Experimentation and want to skip the request.
|
|
96
|
+
*/
|
|
97
|
+
fetchGoals?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* A function which, if present, can change the URL in analytics events to something other
|
|
100
|
+
* than the actual browser URL. It will be called with the current browser URL as a parameter,
|
|
101
|
+
* and returns the value that should be stored in the event's `url` property.
|
|
102
|
+
*
|
|
103
|
+
* It may be useful to customize the `url` to provide specific meaning, incorporate
|
|
104
|
+
* client-side routing concerns, or redact tokens or other info.
|
|
105
|
+
*/
|
|
106
|
+
eventUrlTransformer?: (url: string) => string;
|
|
107
|
+
/**
|
|
108
|
+
* Whether or not to open a streaming connection to LaunchDarkly for live flag updates.
|
|
109
|
+
*
|
|
110
|
+
* If this is true, the client will always attempt to maintain a streaming connection; if false,
|
|
111
|
+
* it never will. If you leave the value undefined (the default), the client will open a streaming
|
|
112
|
+
* connection if you subscribe to `"change"` or `"change:flag-key"` events.
|
|
113
|
+
*
|
|
114
|
+
* This is equivalent to calling `client.setStreaming()` with the same value.
|
|
115
|
+
*/
|
|
116
|
+
streaming?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Determines if the SDK responds to entering different visibility states, such as foreground and background.
|
|
119
|
+
* An example is flushing buffered events when going to the background.
|
|
120
|
+
*
|
|
121
|
+
* This is true by default. Generally speaking the SDK will be able to most reliably deliver
|
|
122
|
+
* events with this setting on.
|
|
123
|
+
*
|
|
124
|
+
* It may be useful to disable for environments where not all window/document objects are
|
|
125
|
+
* available, such as when running the SDK in a browser extension.
|
|
126
|
+
*/
|
|
127
|
+
automaticBackgroundHandling?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* A list of plugins to be used with the SDK.
|
|
130
|
+
*
|
|
131
|
+
* Plugin support is currently experimental and subject to change.
|
|
132
|
+
*/
|
|
133
|
+
plugins?: LDPlugin[];
|
|
134
|
+
}
|
|
135
|
+
|
|
124
136
|
/**
|
|
125
137
|
* Provides a basic {@link LDLogger} implementation.
|
|
126
138
|
*
|
|
@@ -171,4 +183,4 @@ type LDClient = Omit<LDClient$1, 'setConnectionMode' | 'getConnectionMode' | 'ge
|
|
|
171
183
|
*/
|
|
172
184
|
declare function basicLogger(options: BasicLoggerOptions): LDLogger;
|
|
173
185
|
|
|
174
|
-
export { type BrowserOptions as B, type LDClient as L, type
|
|
186
|
+
export { type BrowserOptions as B, type LDClient as L, type LDPlugin as a, type BrowserIdentifyOptions as b, basicLogger as c };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LDIdentifyOptions,
|
|
1
|
+
import { LDIdentifyOptions, LDClient as LDClient$1, LDContext, LDPluginBase, Hook, LDOptions, BasicLoggerOptions, LDLogger } from '@launchdarkly/js-client-sdk-common';
|
|
2
2
|
|
|
3
3
|
interface BrowserIdentifyOptions extends Omit<LDIdentifyOptions, 'waitForNetworkResults'> {
|
|
4
4
|
/**
|
|
@@ -22,49 +22,6 @@ interface BrowserIdentifyOptions extends Omit<LDIdentifyOptions, 'waitForNetwork
|
|
|
22
22
|
bootstrap?: unknown;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Initialization options for the LaunchDarkly browser SDK.
|
|
27
|
-
*/
|
|
28
|
-
interface BrowserOptions extends Omit<LDOptions, 'initialConnectionMode'> {
|
|
29
|
-
/**
|
|
30
|
-
* Whether the client should make a request to LaunchDarkly for Experimentation metrics (goals).
|
|
31
|
-
*
|
|
32
|
-
* This is true by default, meaning that this request will be made on every page load.
|
|
33
|
-
* Set it to false if you are not using Experimentation and want to skip the request.
|
|
34
|
-
*/
|
|
35
|
-
fetchGoals?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* A function which, if present, can change the URL in analytics events to something other
|
|
38
|
-
* than the actual browser URL. It will be called with the current browser URL as a parameter,
|
|
39
|
-
* and returns the value that should be stored in the event's `url` property.
|
|
40
|
-
*
|
|
41
|
-
* It may be useful to customize the `url` to provide specific meaning, incorporate
|
|
42
|
-
* client-side routing concerns, or redact tokens or other info.
|
|
43
|
-
*/
|
|
44
|
-
eventUrlTransformer?: (url: string) => string;
|
|
45
|
-
/**
|
|
46
|
-
* Whether or not to open a streaming connection to LaunchDarkly for live flag updates.
|
|
47
|
-
*
|
|
48
|
-
* If this is true, the client will always attempt to maintain a streaming connection; if false,
|
|
49
|
-
* it never will. If you leave the value undefined (the default), the client will open a streaming
|
|
50
|
-
* connection if you subscribe to `"change"` or `"change:flag-key"` events.
|
|
51
|
-
*
|
|
52
|
-
* This is equivalent to calling `client.setStreaming()` with the same value.
|
|
53
|
-
*/
|
|
54
|
-
streaming?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Determines if the SDK responds to entering different visibility states, such as foreground and background.
|
|
57
|
-
* An example is flushing buffered events when going to the background.
|
|
58
|
-
*
|
|
59
|
-
* This is true by default. Generally speaking the SDK will be able to most reliably deliver
|
|
60
|
-
* events with this setting on.
|
|
61
|
-
*
|
|
62
|
-
* It may be useful to disable for environments where not all window/document objects are
|
|
63
|
-
* available, such as when running the SDK in a browser extension.
|
|
64
|
-
*/
|
|
65
|
-
automaticBackgroundHandling?: boolean;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
25
|
/**
|
|
69
26
|
*
|
|
70
27
|
* The LaunchDarkly SDK client object.
|
|
@@ -121,6 +78,61 @@ type LDClient = Omit<LDClient$1, 'setConnectionMode' | 'getConnectionMode' | 'ge
|
|
|
121
78
|
identify(context: LDContext, identifyOptions?: BrowserIdentifyOptions): Promise<void>;
|
|
122
79
|
};
|
|
123
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Interface for plugins to the LaunchDarkly SDK.
|
|
83
|
+
*/
|
|
84
|
+
interface LDPlugin extends LDPluginBase<LDClient, Hook> {
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Initialization options for the LaunchDarkly browser SDK.
|
|
89
|
+
*/
|
|
90
|
+
interface BrowserOptions extends Omit<LDOptions, 'initialConnectionMode'> {
|
|
91
|
+
/**
|
|
92
|
+
* Whether the client should make a request to LaunchDarkly for Experimentation metrics (goals).
|
|
93
|
+
*
|
|
94
|
+
* This is true by default, meaning that this request will be made on every page load.
|
|
95
|
+
* Set it to false if you are not using Experimentation and want to skip the request.
|
|
96
|
+
*/
|
|
97
|
+
fetchGoals?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* A function which, if present, can change the URL in analytics events to something other
|
|
100
|
+
* than the actual browser URL. It will be called with the current browser URL as a parameter,
|
|
101
|
+
* and returns the value that should be stored in the event's `url` property.
|
|
102
|
+
*
|
|
103
|
+
* It may be useful to customize the `url` to provide specific meaning, incorporate
|
|
104
|
+
* client-side routing concerns, or redact tokens or other info.
|
|
105
|
+
*/
|
|
106
|
+
eventUrlTransformer?: (url: string) => string;
|
|
107
|
+
/**
|
|
108
|
+
* Whether or not to open a streaming connection to LaunchDarkly for live flag updates.
|
|
109
|
+
*
|
|
110
|
+
* If this is true, the client will always attempt to maintain a streaming connection; if false,
|
|
111
|
+
* it never will. If you leave the value undefined (the default), the client will open a streaming
|
|
112
|
+
* connection if you subscribe to `"change"` or `"change:flag-key"` events.
|
|
113
|
+
*
|
|
114
|
+
* This is equivalent to calling `client.setStreaming()` with the same value.
|
|
115
|
+
*/
|
|
116
|
+
streaming?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Determines if the SDK responds to entering different visibility states, such as foreground and background.
|
|
119
|
+
* An example is flushing buffered events when going to the background.
|
|
120
|
+
*
|
|
121
|
+
* This is true by default. Generally speaking the SDK will be able to most reliably deliver
|
|
122
|
+
* events with this setting on.
|
|
123
|
+
*
|
|
124
|
+
* It may be useful to disable for environments where not all window/document objects are
|
|
125
|
+
* available, such as when running the SDK in a browser extension.
|
|
126
|
+
*/
|
|
127
|
+
automaticBackgroundHandling?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* A list of plugins to be used with the SDK.
|
|
130
|
+
*
|
|
131
|
+
* Plugin support is currently experimental and subject to change.
|
|
132
|
+
*/
|
|
133
|
+
plugins?: LDPlugin[];
|
|
134
|
+
}
|
|
135
|
+
|
|
124
136
|
/**
|
|
125
137
|
* Provides a basic {@link LDLogger} implementation.
|
|
126
138
|
*
|
|
@@ -171,4 +183,4 @@ type LDClient = Omit<LDClient$1, 'setConnectionMode' | 'getConnectionMode' | 'ge
|
|
|
171
183
|
*/
|
|
172
184
|
declare function basicLogger(options: BasicLoggerOptions): LDLogger;
|
|
173
185
|
|
|
174
|
-
export { type BrowserOptions as B, type LDClient as L, type
|
|
186
|
+
export { type BrowserOptions as B, type LDClient as L, type LDPlugin as a, type BrowserIdentifyOptions as b, basicLogger as c };
|