Skip to content

Commit 61bfbfd

Browse files
committed
chore: update LaunchDarkly SDK dependencies and refactor client initialization
- Updated `@launchdarkly/js-client-sdk` version from `^0.4.1` to `^0.11.0` in multiple package.json files. - Refactored client initialization in `highlight-buttons.tsx` and `highlight-identify.tsx` to use `createClient` instead of `initialize`, and added user and organization context during client creation.
1 parent 069c518 commit 61bfbfd

File tree

6 files changed

+41
-52
lines changed

6 files changed

+41
-52
lines changed

e2e/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dependencies": {
1616
"@highlight-run/next": "workspace:*",
1717
"@highlight-run/pino": "workspace:*",
18-
"@launchdarkly/js-client-sdk": "^0.4.1",
18+
"@launchdarkly/js-client-sdk": "^0.11.0",
1919
"@next/env": "^15.1.7",
2020
"@prisma/client": "^6.4.1",
2121
"@prisma/instrumentation": "^6.4.1",

e2e/nextjs/src/app/components/highlight-buttons.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ import { CONSTANTS } from '@/constants'
77

88
export function HighlightButtons() {
99
const ldClientPromise = useMemo(async () => {
10-
const { initialize } = await import('@launchdarkly/js-client-sdk')
11-
const ldClient = initialize(
10+
const { createClient } = await import('@launchdarkly/js-client-sdk')
11+
const ldClient = createClient(
1212
CONSTANTS.NEXT_PUBLIC_LAUNCHDARKLY_SDK_KEY ?? '',
13+
{
14+
kind: 'multi',
15+
user: { key: 'vadim' },
16+
org: { key: 'tester' },
17+
}
1318
)
1419
H.registerLD(ldClient)
20+
await ldClient.start();
21+
1522
return ldClient
1623
}, [])
1724
return (

e2e/nextjs/src/app/components/highlight-identify.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@ import { CONSTANTS } from '@/constants'
66

77
export function HighlightIdentify() {
88
const ldClientPromise = useMemo(async () => {
9-
const { initialize } = await import('@launchdarkly/js-client-sdk')
10-
const ldClient = initialize(
9+
const { createClient } = await import('@launchdarkly/js-client-sdk')
10+
const ldClient = createClient(
1111
CONSTANTS.NEXT_PUBLIC_LAUNCHDARKLY_SDK_KEY ?? '',
12+
{
13+
kind: 'multi',
14+
user: { key: 'bob' },
15+
org: { key: 'MacDonwalds' },
16+
}
1217
)
1318
H.registerLD(ldClient)
19+
await ldClient.start();
20+
1421
return ldClient
1522
}, [])
1623
useEffect(() => {

e2e/react-router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@highlight-run/react": "workspace:*",
14-
"@launchdarkly/js-client-sdk": "^0.6.0",
14+
"@launchdarkly/js-client-sdk": "^0.11.0",
1515
"@launchdarkly/observability": "workspace:*",
1616
"@launchdarkly/session-replay": "workspace:*",
1717
"launchdarkly-js-client-sdk": "3.8.1",

sdk/highlight-run/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"dist"
8282
],
8383
"dependencies": {
84-
"@launchdarkly/js-client-sdk": "^0.6.0",
84+
"@launchdarkly/js-client-sdk": "^0.11.0",
8585
"imurmurhash": "^0.1.4"
8686
},
8787
"devDependencies": {

yarn.lock

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8411,24 +8411,6 @@ __metadata:
84118411
languageName: node
84128412
linkType: hard
84138413

8414-
"@launchdarkly/js-client-sdk-common@npm:1.12.3":
8415-
version: 1.12.3
8416-
resolution: "@launchdarkly/js-client-sdk-common@npm:1.12.3"
8417-
dependencies:
8418-
"@launchdarkly/js-sdk-common": "npm:2.13.0"
8419-
checksum: 10/1a68b443c0d4f577cf9ad20dc5ed2a4d01b87a17a4621db8aaf9931bf506bcf92042202de4a1822921cd7cbdea759a8787af50b3dafe38275a3cbe8613871aea
8420-
languageName: node
8421-
linkType: hard
8422-
8423-
"@launchdarkly/js-client-sdk-common@npm:1.13.0":
8424-
version: 1.13.0
8425-
resolution: "@launchdarkly/js-client-sdk-common@npm:1.13.0"
8426-
dependencies:
8427-
"@launchdarkly/js-sdk-common": "npm:2.17.0"
8428-
checksum: 10/754d0b873714adac5d63fa3b5c416fcc8e089d09bf9061aa30e038a171c647cf4cfe0aded0f33ace02545cd0ef02e011500241ccdcda412fb6e514492b51e730
8429-
languageName: node
8430-
linkType: hard
8431-
84328414
"@launchdarkly/js-client-sdk-common@npm:1.15.0":
84338415
version: 1.15.0
84348416
resolution: "@launchdarkly/js-client-sdk-common@npm:1.15.0"
@@ -8438,35 +8420,21 @@ __metadata:
84388420
languageName: node
84398421
linkType: hard
84408422

8441-
"@launchdarkly/js-client-sdk@npm:^0.4.1":
8442-
version: 0.4.1
8443-
resolution: "@launchdarkly/js-client-sdk@npm:0.4.1"
8423+
"@launchdarkly/js-client-sdk-common@npm:1.16.0":
8424+
version: 1.16.0
8425+
resolution: "@launchdarkly/js-client-sdk-common@npm:1.16.0"
84448426
dependencies:
8445-
"@launchdarkly/js-client-sdk-common": "npm:1.12.3"
8446-
checksum: 10/b949ef137eb8ceeb90afd1ac61e6854f9ec3829fca15a4c1d10cdec0ef0f5baac96acaffaf6c71c1c27a9744cd027a79e5e3fdc79b833dccb53e903f9ba02b33
8427+
"@launchdarkly/js-sdk-common": "npm:2.20.0"
8428+
checksum: 10/afc9e39403fdeefc5de650fa7dae3fd2faa35e7015c2d58acd6e9f0ea0f79c13410c9cd4911ce559dca6b84cee02b782aa1a09901a0b7d191b3684d1e68339ca
84478429
languageName: node
84488430
linkType: hard
84498431

8450-
"@launchdarkly/js-client-sdk@npm:^0.6.0":
8451-
version: 0.6.0
8452-
resolution: "@launchdarkly/js-client-sdk@npm:0.6.0"
8432+
"@launchdarkly/js-client-sdk@npm:^0.11.0":
8433+
version: 0.11.0
8434+
resolution: "@launchdarkly/js-client-sdk@npm:0.11.0"
84538435
dependencies:
8454-
"@launchdarkly/js-client-sdk-common": "npm:1.13.0"
8455-
checksum: 10/b95fb6178055c4c4df9a8f1ca4eadd3a77eb160ec655a6175fa55e4103e03b979caa8eb1a35b9c91109f6fbda086bb34ba91f0ba626635a4bf985258c55463b5
8456-
languageName: node
8457-
linkType: hard
8458-
8459-
"@launchdarkly/js-sdk-common@npm:2.13.0":
8460-
version: 2.13.0
8461-
resolution: "@launchdarkly/js-sdk-common@npm:2.13.0"
8462-
checksum: 10/2c32ff5b5d77af8cfc228476a512ad6191868811af402d0b85586d871c1974cc3386e1a2efa9aece4529d37815b183575e74e7c01179d8183507b5dfd548290e
8463-
languageName: node
8464-
linkType: hard
8465-
8466-
"@launchdarkly/js-sdk-common@npm:2.17.0":
8467-
version: 2.17.0
8468-
resolution: "@launchdarkly/js-sdk-common@npm:2.17.0"
8469-
checksum: 10/09ae02cbfd809b5b926c76aaaf771db11ffa8625c19ecbacc4176a7effc65bd0ec4fcd9fc539312d66910147c263b8143d773a34cc8f9ed3bb8e0a36ff36e29d
8436+
"@launchdarkly/js-client-sdk-common": "npm:1.16.0"
8437+
checksum: 10/56b6565c58663f50225964f393baba40794d57d99f7e0475985c8c1ec404286c406282a9a1f59ce5249a05e2845d8a459f708ab5fc594b81726c32ac59eea13e
84708438
languageName: node
84718439
linkType: hard
84728440

@@ -8477,6 +8445,13 @@ __metadata:
84778445
languageName: node
84788446
linkType: hard
84798447

8448+
"@launchdarkly/js-sdk-common@npm:2.20.0":
8449+
version: 2.20.0
8450+
resolution: "@launchdarkly/js-sdk-common@npm:2.20.0"
8451+
checksum: 10/9997bfb517aa9edaa689b6f44eb86a4847f45d798d8a32c8bd6614af42f5ab432acac989d755578137db2892aad43c32eb8ad61330ced24ecfbf001855349116
8452+
languageName: node
8453+
linkType: hard
8454+
84808455
"@launchdarkly/js-server-sdk-common@npm:2.16.0, @launchdarkly/js-server-sdk-common@npm:^2.15.2":
84818456
version: 2.16.0
84828457
resolution: "@launchdarkly/js-server-sdk-common@npm:2.16.0"
@@ -28156,7 +28131,7 @@ __metadata:
2815628131
"@graphql-codegen/typescript": "npm:^4.0.1"
2815728132
"@graphql-codegen/typescript-graphql-request": "npm:^6.0.1"
2815828133
"@graphql-codegen/typescript-operations": "npm:^4.0.1"
28159-
"@launchdarkly/js-client-sdk": "npm:^0.6.0"
28134+
"@launchdarkly/js-client-sdk": "npm:^0.11.0"
2816028135
"@opentelemetry/api": "npm:^1.9.0"
2816128136
"@opentelemetry/exporter-metrics-otlp-http": "npm:>=0.57.1 < 0.200.0"
2816228137
"@opentelemetry/exporter-trace-otlp-http": "npm:>=0.57.1 < 0.200.0"
@@ -35311,7 +35286,7 @@ __metadata:
3531135286
dependencies:
3531235287
"@highlight-run/next": "workspace:*"
3531335288
"@highlight-run/pino": "workspace:*"
35314-
"@launchdarkly/js-client-sdk": "npm:^0.4.1"
35289+
"@launchdarkly/js-client-sdk": "npm:^0.11.0"
3531535290
"@next/env": "npm:^15.1.7"
3531635291
"@prisma/client": "npm:^6.4.1"
3531735292
"@prisma/instrumentation": "npm:^6.4.1"
@@ -39267,7 +39242,7 @@ __metadata:
3926739242
resolution: "react-router@workspace:e2e/react-router"
3926839243
dependencies:
3926939244
"@highlight-run/react": "workspace:*"
39270-
"@launchdarkly/js-client-sdk": "npm:^0.6.0"
39245+
"@launchdarkly/js-client-sdk": "npm:^0.11.0"
3927139246
"@launchdarkly/observability": "workspace:*"
3927239247
"@launchdarkly/session-replay": "workspace:*"
3927339248
"@types/react": "npm:^19.0.4"

0 commit comments

Comments
 (0)