File tree Expand file tree Collapse file tree 12 files changed +634
-20
lines changed
Expand file tree Collapse file tree 12 files changed +634
-20
lines changed Original file line number Diff line number Diff line change 1111 },
1212 "dependencies" : {
1313 "@highlight-run/react" : " workspace:*" ,
14- "highlight.run" : " workspace:*" ,
14+ "@launchdarkly/js-client-sdk" : " ^0.6.0" ,
15+ "@launchdarkly/observability" : " workspace:*" ,
16+ "@launchdarkly/session-replay" : " workspace:*" ,
1517 "localforage" : " ^1.10.0" ,
1618 "match-sorter" : " ^6.3.1" ,
1719 "react" : " ^19.0.0" ,
Original file line number Diff line number Diff line change 1- import { H } from 'highlight.run'
1+ import { initialize } from '@launchdarkly/js-client-sdk'
2+ import Observability from '@launchdarkly/observability'
3+ import SessionReplay from '@launchdarkly/session-replay'
24
3- H . init ( '1' , {
4- // Get your project ID from https://app.highlight.io/setup
5- networkRecording : {
6- enabled : true ,
7- recordHeadersAndBody : true ,
8- } ,
5+ const client = initialize ( 'client-side-id-123abc' , {
6+ // Not including plugins at all would be equivalent to the current LaunchDarkly SDK.
7+ plugins : [
8+ new Observability ( '1' , {
9+ networkRecording : {
10+ enabled : true ,
11+ recordHeadersAndBody : true ,
12+ } ,
13+ } ) ,
14+ new SessionReplay ( '1' , {
15+ networkRecording : {
16+ enabled : true ,
17+ recordHeadersAndBody : true ,
18+ } ,
19+ } ) , // Could be omitted for customers who cannot use session replay.
20+ ] ,
921} )
1022
1123export default function Root ( ) {
1224 return (
1325 < div id = "sidebar" >
1426 < h1 > Hello, world</ h1 >
27+ < p > { JSON . stringify ( client . allFlags ( ) ) } </ p >
1528 </ div >
1629 )
1730}
Original file line number Diff line number Diff line change 2525 "url" : " https://github.com/launchdarkly/observability-sdk.git"
2626 }
2727 },
28+ "scripts" : {
29+ "typegen" : " tsc" ,
30+ "build" : " vite build"
31+ },
32+ "dependencies" : {
33+ "highlight.run" : " workspace:*"
34+ },
35+ "devDependencies" : {
36+ "typescript" : " ^5.8.3" ,
37+ "vite" : " ^6.3.4" ,
38+ "vitest" : " ^3.1.2"
39+ },
2840 "type" : " module" ,
2941 "main" : " ./dist/index.js" ,
3042 "module" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change 1+ export { Observe as default } from 'highlight.run'
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ../../highlight-run/tsconfig.json" ,
3+ "compilerOptions" : {
4+ "outDir" : " dist" ,
5+ },
6+ "include" : " src" ,
7+ "exclude" : [" **/src/**/*.test.tsx" ],
8+ }
Original file line number Diff line number Diff line change 1+ // vite.config.ts
2+ import { resolve as resolvePath } from 'path'
3+ import { defineConfig } from 'vite'
4+
5+ export default defineConfig ( {
6+ build : {
7+ target : 'esnext' ,
8+ lib : {
9+ formats : [ 'es' ] ,
10+ entry : resolvePath ( __dirname , 'src/index.ts' ) ,
11+ } ,
12+ minify : true ,
13+ sourcemap : true ,
14+ emptyOutDir : false ,
15+ rollupOptions : {
16+ treeshake : 'smallest' ,
17+ output : {
18+ exports : 'named' ,
19+ } ,
20+ cache : false ,
21+ } ,
22+ } ,
23+ } )
Original file line number Diff line number Diff line change 2222 "url" : " https://github.com/launchdarkly/observability-sdk.git"
2323 }
2424 },
25+ "scripts" : {
26+ "typegen" : " tsc" ,
27+ "build" : " vite build"
28+ },
29+ "dependencies" : {
30+ "highlight.run" : " workspace:*"
31+ },
32+ "devDependencies" : {
33+ "typescript" : " ^5.8.3" ,
34+ "vite" : " ^6.3.4" ,
35+ "vitest" : " ^3.1.2"
36+ },
2537 "type" : " module" ,
2638 "main" : " ./dist/index.js" ,
2739 "module" : " ./dist/index.js" ,
Original file line number Diff line number Diff line change 1+ export { Record as default } from 'highlight.run'
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ../../highlight-run/tsconfig.json" ,
3+ "compilerOptions" : {
4+ "outDir" : " dist" ,
5+ },
6+ "include" : " src" ,
7+ "exclude" : [" **/src/**/*.test.tsx" ],
8+ }
Original file line number Diff line number Diff line change 1+ // vite.config.ts
2+ import { resolve as resolvePath } from 'path'
3+ import { defineConfig } from 'vite'
4+
5+ export default defineConfig ( {
6+ build : {
7+ target : 'esnext' ,
8+ lib : {
9+ formats : [ 'es' ] ,
10+ entry : resolvePath ( __dirname , 'src/index.ts' ) ,
11+ } ,
12+ minify : true ,
13+ sourcemap : true ,
14+ emptyOutDir : false ,
15+ rollupOptions : {
16+ treeshake : 'smallest' ,
17+ output : {
18+ exports : 'named' ,
19+ } ,
20+ cache : false ,
21+ } ,
22+ } ,
23+ } )
You can’t perform that action at this time.
0 commit comments