Skip to content

Commit 4fc7efb

Browse files
yusintoLaunchDarklyReleaseBot
andauthored
chore: re-export types from js client sdk (#114)
Co-authored-by: LaunchDarklyReleaseBot <[email protected]>
1 parent c66198d commit 4fc7efb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

examples/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@types/node": "^16.18.18",
1111
"@types/react": "^18.0.28",
1212
"@types/react-dom": "^18.0.11",
13-
"launchdarkly-react-client-sdk": "^3.0.4",
13+
"launchdarkly-react-client-sdk": "^3.0.8",
1414
"react": "^18.2.0",
1515
"react-dom": "^18.2.0",
1616
"react-scripts": "5.0.1",

examples/typescript/src/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ import ReactDOM from 'react-dom/client';
33
import './index.css';
44
import App from './App';
55
import reportWebVitals from './reportWebVitals';
6-
import { asyncWithLDProvider } from 'launchdarkly-react-client-sdk';
6+
import { asyncWithLDProvider, LDContext } from 'launchdarkly-react-client-sdk';
77

88
(async () => {
99
// Set clientSideID to your own Client-side ID. You can find this in
1010
// your LaunchDarkly portal under Account settings / Projects
11+
const context: LDContext = {
12+
kind: 'user',
13+
key: 'test-user-1',
14+
};
15+
1116
const LDProvider = await asyncWithLDProvider({
12-
clientSideID: process.env.REACT_APP_LD_CLIENT_SIDE_ID ?? '',
17+
clientSideID: process.env.REACT_APP_LD_CLIENT_SIDE_ID ?? '59b2b2596d1a250b1c78baa4',
18+
context,
1319
});
1420

1521
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,5 @@ export interface AllFlagsLDClient {
146146
export interface LDFlagKeyMap {
147147
[camelCasedKey: string]: string;
148148
}
149+
150+
export * from 'launchdarkly-js-client-sdk';

0 commit comments

Comments
 (0)