Skip to content

Conversation

@kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented Nov 14, 2025

Originally the SDK API had an identify method which didn't return any result. We added an identifyResult which is a safer API.

We have decided that we shouldn't support the less-safe API and instead should have a single identify method. So the regular identify method will now have the behavior of identifyResult.

This moves the browser client to use a PIMPL implementation to decouple its interface of the inheritance hierarchy. Which allows for identify to have a completely different signature than the base implementation. It also allows us to retain identify in RN until we are ready to do a major version.

For the PIMPL implementation I decided to use a factory instead of a class. So tests needed updated to use that factory.

I also re-organized plugin registration so the better encapsulate PIMPL implementation would be passed to register.

The "compat" adapter needed to be updated to use the new API. For now it supports using the old interface, but we may want to consider removing it if we determine it isn't safe.


Note

Replaces the BrowserClient class with a makeClient factory using a PIMPL impl and changes identify to return LDIdentifyResult (replacing identifyResult); updates plugin registration, compat, initialization, and tests.

  • API
    • identify now returns LDIdentifyResult (with statuses like completed/shed/timeout/error) and accepts browser-specific options; identifyResult is removed from the public interface.
    • Introduce factory makeClient wrapping an internal BrowserClientImpl (PIMPL); initialize now uses makeClient.
    • LDClient type updated to expose the new identify signature and omit the old one.
  • Plugins
    • Refactor plugin registration to register against the public PIMPL client; hook retrieval unchanged; environment metadata still forwarded.
  • Compat
    • LDClientCompatImpl updated to use makeClient and new identify result handling; passes sheddable: false, propagates bootstrap/hash, and maps failures/timeouts.
  • Tests
    • Migrate tests to makeClient; adjust expectations for identify return values and shedding behavior; verify plugin registration and environment metadata.

Written by Cursor Bugbot for commit 4df7885. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 169118 bytes
Compressed size limit: 200000
Uncompressed size: 789399 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 24988 bytes
Compressed size limit: 26000
Uncompressed size: 122411 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 17636 bytes
Compressed size limit: 20000
Uncompressed size: 90259 bytes

@kinyoklion kinyoklion force-pushed the rlamb/SDK-1375/only-support-identify-with-result branch from 665601f to 44f6e9d Compare November 14, 2025 22:38
@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 21981 bytes
Compressed size limit: 25000
Uncompressed size: 75580 bytes

@kinyoklion
Copy link
Member Author

bugbot review

@kinyoklion kinyoklion force-pushed the rlamb/SDK-1375/only-support-identify-with-result branch 2 times, most recently from e602b5b to eca0091 Compare November 14, 2025 22:58
@kinyoklion kinyoklion force-pushed the rlamb/SDK-1375/only-support-identify-with-result branch from eca0091 to 4df7885 Compare November 14, 2025 23:00
@kinyoklion kinyoklion marked this pull request as ready for review November 14, 2025 23:08
@kinyoklion kinyoklion requested a review from a team as a code owner November 14, 2025 23:08
@kinyoklion kinyoklion merged commit 7163adf into main Nov 17, 2025
37 checks passed
@kinyoklion kinyoklion deleted the rlamb/SDK-1375/only-support-identify-with-result branch November 17, 2025 18:35
@github-actions github-actions bot mentioned this pull request Nov 17, 2025
jsonbailey added a commit that referenced this pull request Nov 21, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>akamai-server-base-sdk: 3.0.11</summary>

##
[3.0.11](akamai-server-base-sdk-v3.0.10...akamai-server-base-sdk-v3.0.11)
(2025-11-21)


### Bug Fixes

* Use release-please to update SDK versions
([#1013](#1013))
([d1d11f1](d1d11f1))
</details>

<details><summary>akamai-server-edgekv-sdk: 1.4.13</summary>

##
[1.4.13](akamai-server-edgekv-sdk-v1.4.12...akamai-server-edgekv-sdk-v1.4.13)
(2025-11-21)


### Bug Fixes

* Use release-please to update SDK versions
([#1013](#1013))
([d1d11f1](d1d11f1))
</details>

<details><summary>browser-telemetry: 1.0.12</summary>

##
[1.0.12](browser-telemetry-v1.0.11...browser-telemetry-v1.0.12)
(2025-11-21)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-client-sdk bumped from 0.8.1 to 0.9.0
</details>

<details><summary>fastly-server-sdk: 0.2.2</summary>

##
[0.2.2](fastly-server-sdk-v0.2.1...fastly-server-sdk-v0.2.2)
(2025-11-21)


### Bug Fixes

* Use release-please to update SDK versions
([#1013](#1013))
([d1d11f1](d1d11f1))
</details>

<details><summary>jest: 0.1.13</summary>

##
[0.1.13](jest-v0.1.12...jest-v0.1.13)
(2025-11-21)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/react-native-client-sdk bumped from ~10.12.0 to ~10.12.1
</details>

<details><summary>js-client-sdk: 0.9.0</summary>

##
[0.9.0](js-client-sdk-v0.8.1...js-client-sdk-v0.9.0)
(2025-11-21)


### ⚠ BREAKING CHANGES

* Only support identify with result.
([#1000](#1000))

### Features

* Only support identify with result.
([#1000](#1000))
([7163adf](7163adf))
</details>

<details><summary>node-server-sdk: 9.10.3</summary>

##
[9.10.3](node-server-sdk-v9.10.2...node-server-sdk-v9.10.3)
(2025-11-21)


### Bug Fixes

* Use release-please to update SDK versions
([#1013](#1013))
([d1d11f1](d1d11f1))
</details>

<details><summary>node-server-sdk-dynamodb: 6.2.15</summary>

##
[6.2.15](node-server-sdk-dynamodb-v6.2.14...node-server-sdk-dynamodb-v6.2.15)
(2025-11-21)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.10.2 to 9.10.3
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.3
</details>

<details><summary>node-server-sdk-otel: 1.3.3</summary>

##
[1.3.3](node-server-sdk-otel-v1.3.2...node-server-sdk-otel-v1.3.3)
(2025-11-21)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.10.2 to 9.10.3
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.3
</details>

<details><summary>node-server-sdk-redis: 4.2.15</summary>

##
[4.2.15](node-server-sdk-redis-v4.2.14...node-server-sdk-redis-v4.2.15)
(2025-11-21)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.10.2 to 9.10.3
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.3
</details>

<details><summary>react-native-client-sdk: 10.12.1</summary>

##
[10.12.1](react-native-client-sdk-v10.12.0...react-native-client-sdk-v10.12.1)
(2025-11-21)


### Bug Fixes

* Use release-please to update SDK versions
([#1013](#1013))
([d1d11f1](d1d11f1))
</details>

<details><summary>server-sdk-ai: 0.15.0</summary>

##
[0.15.0](server-sdk-ai-v0.14.1...server-sdk-ai-v0.15.0)
(2025-11-21)


### ⚠ BREAKING CHANGES

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))

### Bug Fixes

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))
([11de076](11de076))
</details>

<details><summary>server-sdk-ai-langchain: 0.4.0</summary>

##
[0.4.0](server-sdk-ai-langchain-v0.3.1...server-sdk-ai-langchain-v0.4.0)
(2025-11-21)


### ⚠ BREAKING CHANGES

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))

### Bug Fixes

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))
([11de076](11de076))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.14.1 to ^0.15.0
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.14.0 to ^0.15.0
</details>

<details><summary>server-sdk-ai-openai: 0.4.0</summary>

##
[0.4.0](server-sdk-ai-openai-v0.3.1...server-sdk-ai-openai-v0.4.0)
(2025-11-21)


### ⚠ BREAKING CHANGES

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))

### Bug Fixes

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))
([11de076](11de076))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.14.1 to ^0.15.0
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.14.0 to ^0.15.0
</details>

<details><summary>server-sdk-ai-vercel: 0.4.0</summary>

##
[0.4.0](server-sdk-ai-vercel-v0.3.1...server-sdk-ai-vercel-v0.4.0)
(2025-11-21)


### ⚠ BREAKING CHANGES

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))

### Bug Fixes

* Change to ES Modules to improve support of dynamic loading
([#1011](#1011))
([11de076](11de076))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.14.1 to ^0.15.0
  * peerDependencies
    * @launchdarkly/server-sdk-ai bumped from ^0.14.0 to ^0.15.0
</details>

<details><summary>vercel-server-sdk: 1.3.35</summary>

##
[1.3.35](vercel-server-sdk-v1.3.34...vercel-server-sdk-v1.3.35)
(2025-11-21)


### Bug Fixes

* Use release-please to update SDK versions
([#1013](#1013))
([d1d11f1](d1d11f1))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Bumps versions across SDKs and providers, migrates AI providers to ES
modules, releases browser SDK 0.9.0 with a breaking identify API change,
and updates examples/tests and dependent packages accordingly.
> 
> - **AI Providers (server)**
> - **ESM migration (breaking)**:
`@launchdarkly/server-sdk-ai-{openai,langchain,vercel}` to `0.4.0`;
peer/dev deps updated to `@launchdarkly/server-sdk-ai@^0.15.0`.
> - **AI SDK**: `@launchdarkly/server-sdk-ai` to `0.15.0`; version
constant updated in `sdkInfo.ts`.
> - **Browser SDK**
> - **0.9.0 (breaking)**: only support identify with result; version
wired into `BrowserInfo.ts` and tests now read name/version from
`package.json`.
> - **Telemetry**: `@launchdarkly/browser-telemetry` to `1.0.12` (devDep
on browser SDK `0.9.0`).
> - **Edge/Server SDKs**
> - Akamai base to `3.0.11` and EdgeKV to `1.4.13`; version constants
and examples updated.
>   - Fastly to `0.2.2`; version constants and example updated.
>   - Vercel to `1.3.35`; version constant updated.
>   - Node server SDK to `9.10.3`; version constant updated.
> - **Stores/Telemetry tooling**
> - DynamoDB store to `6.2.15`, Redis store to `4.2.15`, OTEL to `1.3.3`
(devDeps bumped to Node SDK `9.10.3`).
>   - Jest tooling to `0.1.13` (dep on RN SDK `~10.12.1`).
> - **React Native**
>   - RN SDK to `10.12.1`; version constant updated.
> - **Manifest**
>   - `.release-please-manifest.json` updated for all version bumps.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6a0e582. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jsonbailey <jbailey@launchdarkly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants