Skip to content

Commit d2775d0

Browse files
authored
Merge branch 'launchdarkly:main' into main
2 parents 602ff36 + f0b9b5d commit d2775d0

File tree

15 files changed

+248
-10
lines changed

15 files changed

+248
-10
lines changed

.github/workflows/server-ai.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '**.md'
1212

1313
jobs:
14-
build-test-node-server-otel:
14+
build-test-server-sdk-ai:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
@@ -35,3 +35,8 @@ jobs:
3535
yarn workspaces focus @launchdarkly/hello-openai
3636
yarn workspace @launchdarkly/hello-openai lint
3737
yarn workspaces foreach -pR --topological-dev --from '@launchdarkly/hello-openai' run build
38+
- name: Build Vercel AI example
39+
run: |
40+
yarn workspaces focus @launchdarkly/hello-vercel-ai
41+
yarn workspace @launchdarkly/hello-vercel-ai lint
42+
yarn workspaces foreach -pR --topological-dev --from '@launchdarkly/hello-vercel-ai' run build

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
"packages/store/node-server-sdk-dynamodb": "6.2.14",
1313
"packages/store/node-server-sdk-redis": "4.2.14",
1414
"packages/shared/sdk-client": "1.15.1",
15-
"packages/sdk/react-native": "10.10.5",
15+
"packages/sdk/react-native": "10.11.0",
1616
"packages/telemetry/node-server-sdk-otel": "1.3.2",
1717
"packages/sdk/browser": "0.8.1",
1818
"packages/sdk/server-ai": "0.11.4",
1919
"packages/telemetry/browser-telemetry": "1.0.11",
20-
"packages/tooling/jest": "0.1.10",
20+
"packages/tooling/jest": "0.1.11",
2121
"packages/sdk/combined-browser": "0.0.0"
2222
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"packages/sdk/server-ai",
3434
"packages/sdk/server-ai/examples/bedrock",
3535
"packages/sdk/server-ai/examples/openai",
36+
"packages/sdk/server-ai/examples/vercel-ai",
3637
"packages/telemetry/browser-telemetry",
3738
"contract-tests",
3839
"packages/sdk/combined-browser"

packages/sdk/react-native/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## [10.11.0](https://github.com/launchdarkly/js-core/compare/react-native-client-sdk-v10.10.5...react-native-client-sdk-v10.11.0) (2025-09-16)
4+
5+
6+
### Features
7+
8+
* Update react native async local storage to v2. ([#930](https://github.com/launchdarkly/js-core/issues/930)) ([4888b33](https://github.com/launchdarkly/js-core/commit/4888b33f28cedb22426b13a02697b1c25a2711d1))
9+
310
## [10.10.5](https://github.com/launchdarkly/js-core/compare/react-native-client-sdk-v10.10.4...react-native-client-sdk-v10.10.5) (2025-07-23)
411

512

packages/sdk/react-native/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"dependencies": {
2424
"@launchdarkly/react-native-client-sdk": "workspace:^",
25-
"@react-native-async-storage/async-storage": "^1.21.0",
25+
"@react-native-async-storage/async-storage": "^2.0.0",
2626
"expo": "52.0.14",
2727
"expo-status-bar": "~1.11.1",
2828
"react": "18.3.1",

packages/sdk/react-native/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@launchdarkly/react-native-client-sdk",
3-
"version": "10.10.5",
3+
"version": "10.11.0",
44
"description": "React Native LaunchDarkly SDK",
55
"homepage": "https://github.com/launchdarkly/js-core/tree/main/packages/sdk/react-native",
66
"repository": {
@@ -42,7 +42,7 @@
4242
},
4343
"dependencies": {
4444
"@launchdarkly/js-client-sdk-common": "1.15.1",
45-
"@react-native-async-storage/async-storage": "^1.21.0",
45+
"@react-native-async-storage/async-storage": "^2.0.0",
4646
"base64-js": "^1.5.1"
4747
},
4848
"devDependencies": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["/**/*.ts", "/**/*.tsx"],
3+
"include": ["**/*.ts", "**/*.tsx"],
44
"exclude": ["node_modules"]
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["/**/*.ts", "/**/*.tsx"],
3+
"include": ["**/*.ts", "**/*.tsx"],
44
"exclude": ["node_modules"]
55
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# LaunchDarkly AI SDK for OpenAI Example
2+
3+
This package demonstrates the integration of LaunchDarkly's AI SDK with OpenAI via Vercel AI, allowing you to leverage LaunchDarkly's AI Config capabilities in AI-powered applications using Vercel's services.
4+
5+
## Installation and Build
6+
7+
When running as part of the js-core mono-repo the project will use local dependencies.
8+
As such those dependencies need built.
9+
10+
In the root of the repository run:
11+
12+
```bash
13+
yarn
14+
```
15+
16+
And then
17+
18+
```bash
19+
yarn build
20+
```
21+
22+
## Configuration
23+
24+
Before running the example, make sure to set the following environment variables:
25+
26+
- `LAUNCHDARKLY_SDK_KEY`: Your LaunchDarkly SDK key
27+
- `LAUNCHDARKLY_AI_CONFIG_KEY`: Your LaunchDarkly AI Config key (defaults to 'sample-ai-config' if not set)
28+
- `OPENAI_API_KEY`: Your OpenAI API key
29+
30+
## Usage
31+
32+
The main script (`index.js`) demonstrates how to:
33+
34+
1. Initialize the LaunchDarkly SDK
35+
2. Set up a user context
36+
3. Initialize the LaunchDarkly AI client
37+
4. Retrieve an AI model configuration
38+
5. Send a prompt to a Vercel AI Model (OpenAI)
39+
6. Track token usage
40+
41+
To run the example (in the vercel-ai directory):
42+
43+
```bash
44+
yarn start
45+
```
46+
47+
## Note
48+
49+
This example uses OpenAI's chat completions API. Make sure your LaunchDarkly AI Config is set up correctly to work with OpenAI's models and API structure.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
{
2+
"name": "@launchdarkly/hello-vercel-ai",
3+
"version": "0.1.0",
4+
"description": "LaunchDarkly AI SDK for Node.js with Vercel AI",
5+
"private": true,
6+
"main": "dist/index.js",
7+
"types": "dist/index.d.ts",
8+
"scripts": {
9+
"build": "tsc",
10+
"start": "yarn build && node ./dist/index.js",
11+
"lint": "npx eslint . --ext .ts",
12+
"prettier": "prettier --write '**/*.@(js|ts|tsx|json|css)' --ignore-path ../../../.prettierignore",
13+
"lint:fix": "yarn run lint --fix",
14+
"check": "yarn prettier && yarn lint && yarn build && yarn test"
15+
},
16+
"keywords": [
17+
"launchdarkly",
18+
"ai",
19+
"llm"
20+
],
21+
"author": "LaunchDarkly",
22+
"license": "Apache-2.0",
23+
"dependencies": {
24+
"@ai-sdk/openai": "2.0.30",
25+
"@launchdarkly/node-server-sdk": "9.7.1",
26+
"@launchdarkly/server-sdk-ai": "0.11.3",
27+
"ai": "5.0.0",
28+
"zod": "^3.23.8"
29+
},
30+
"devDependencies": {
31+
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
32+
"@tsconfig/node20": "20.1.4",
33+
"@typescript-eslint/eslint-plugin": "^6.20.0",
34+
"@typescript-eslint/parser": "^6.20.0",
35+
"eslint": "^8.45.0",
36+
"eslint-config-airbnb-base": "^15.0.0",
37+
"eslint-config-airbnb-typescript": "^17.1.0",
38+
"eslint-config-prettier": "^8.8.0",
39+
"eslint-plugin-import": "^2.27.5",
40+
"eslint-plugin-jest": "^27.6.3",
41+
"eslint-plugin-prettier": "^5.0.0",
42+
"jest": "^29.7.0",
43+
"prettier": "^3.0.0",
44+
"rimraf": "^5.0.5",
45+
"typedoc": "0.25.0",
46+
"typescript": "^5.5.3"
47+
},
48+
"directories": {
49+
"example": "example"
50+
},
51+
"repository": {
52+
"type": "git",
53+
"url": "github.com/launchdarkly/js-core"
54+
}
55+
}

0 commit comments

Comments
 (0)