@launchdarkly/browser 0.1.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.
@@ -0,0 +1,63 @@
1
+ import { LDOptions, LDContext, LDClient } from '@launchdarkly/js-client-sdk';
2
+ export * from '@launchdarkly/js-client-sdk';
3
+ import { ObserveOptions } from '@launchdarkly/observability';
4
+ export { LDObserve, ObserveOptions } from '@launchdarkly/observability';
5
+ import { RecordOptions } from '@launchdarkly/session-replay';
6
+ export { LDRecord, RecordOptions } from '@launchdarkly/session-replay';
7
+
8
+ /**
9
+ * This is the API reference for the LaunchDarkly Client-Side SDK for JavaScript with included Observability.
10
+ *
11
+ * This SDK is intended for use in browser environments. It includes the observability and session replay plugins.
12
+ *
13
+ * In typical usage, you will call {@link createClient} once at startup time to obtain an instance of
14
+ * {@link LDClient}, which provides access to all of the SDK's functionality.
15
+ *
16
+ * For more information, see the [SDK Reference Guide](https://docs.launchdarkly.com/sdk/client-side/javascript).
17
+ *
18
+ * @packageDocumentation
19
+ */
20
+
21
+ /**
22
+ * Initialization options for the browser SDK and observability plugins.
23
+ */
24
+ interface LDBrowserOptions extends LDOptions {
25
+ /**
26
+ * The project ID for observability. This is a temporary option and will be removed before the 1.0.0 release.
27
+ */
28
+ tmpProjectId: string;
29
+ /**
30
+ * Configuration for the observability plugin.
31
+ */
32
+ observability?: ObserveOptions;
33
+ /**
34
+ * Configuration for the session replay plugin.
35
+ */
36
+ sessionReplay?: RecordOptions;
37
+ }
38
+ /**
39
+ * Creates an instance of the LaunchDarkly client. The client is pre-configured for observability.
40
+ *
41
+ * Usage:
42
+ * ```
43
+ * import { createClient } from '@launchdarkly/browser';
44
+ * const client = createClient(clientSideId, context, options);
45
+ *
46
+ * // Attach event listeners and add any additional initialization logic here
47
+ *
48
+ * // Then start the client
49
+ * client.start();
50
+ * ```
51
+ *
52
+ * @param clientSideId
53
+ * The client-side ID, also known as the environment ID.
54
+ * @param context
55
+ * The initial context used to identify the user. @see {@link LDContext}
56
+ * @param options
57
+ * Optional configuration settings.
58
+ * @return
59
+ * The new client instance.
60
+ */
61
+ declare function createClient(clientSideId: string, context: LDContext, options?: LDBrowserOptions): LDClient;
62
+
63
+ export { type LDBrowserOptions, createClient };
@@ -0,0 +1,63 @@
1
+ import { LDOptions, LDContext, LDClient } from '@launchdarkly/js-client-sdk';
2
+ export * from '@launchdarkly/js-client-sdk';
3
+ import { ObserveOptions } from '@launchdarkly/observability';
4
+ export { LDObserve, ObserveOptions } from '@launchdarkly/observability';
5
+ import { RecordOptions } from '@launchdarkly/session-replay';
6
+ export { LDRecord, RecordOptions } from '@launchdarkly/session-replay';
7
+
8
+ /**
9
+ * This is the API reference for the LaunchDarkly Client-Side SDK for JavaScript with included Observability.
10
+ *
11
+ * This SDK is intended for use in browser environments. It includes the observability and session replay plugins.
12
+ *
13
+ * In typical usage, you will call {@link createClient} once at startup time to obtain an instance of
14
+ * {@link LDClient}, which provides access to all of the SDK's functionality.
15
+ *
16
+ * For more information, see the [SDK Reference Guide](https://docs.launchdarkly.com/sdk/client-side/javascript).
17
+ *
18
+ * @packageDocumentation
19
+ */
20
+
21
+ /**
22
+ * Initialization options for the browser SDK and observability plugins.
23
+ */
24
+ interface LDBrowserOptions extends LDOptions {
25
+ /**
26
+ * The project ID for observability. This is a temporary option and will be removed before the 1.0.0 release.
27
+ */
28
+ tmpProjectId: string;
29
+ /**
30
+ * Configuration for the observability plugin.
31
+ */
32
+ observability?: ObserveOptions;
33
+ /**
34
+ * Configuration for the session replay plugin.
35
+ */
36
+ sessionReplay?: RecordOptions;
37
+ }
38
+ /**
39
+ * Creates an instance of the LaunchDarkly client. The client is pre-configured for observability.
40
+ *
41
+ * Usage:
42
+ * ```
43
+ * import { createClient } from '@launchdarkly/browser';
44
+ * const client = createClient(clientSideId, context, options);
45
+ *
46
+ * // Attach event listeners and add any additional initialization logic here
47
+ *
48
+ * // Then start the client
49
+ * client.start();
50
+ * ```
51
+ *
52
+ * @param clientSideId
53
+ * The client-side ID, also known as the environment ID.
54
+ * @param context
55
+ * The initial context used to identify the user. @see {@link LDContext}
56
+ * @param options
57
+ * Optional configuration settings.
58
+ * @return
59
+ * The new client instance.
60
+ */
61
+ declare function createClient(clientSideId: string, context: LDContext, options?: LDBrowserOptions): LDClient;
62
+
63
+ export { type LDBrowserOptions, createClient };