Skip to content

chore: update deprecated API usage in server-ai examples#1294

Merged
jsonbailey merged 2 commits intofeat/ai-sdk-next-releasefrom
jb/aic-1934/update-js-examples
Apr 20, 2026
Merged

chore: update deprecated API usage in server-ai examples#1294
jsonbailey merged 2 commits intofeat/ai-sdk-next-releasefrom
jb/aic-1934/update-js-examples

Conversation

@jsonbailey
Copy link
Copy Markdown
Contributor

@jsonbailey jsonbailey commented Apr 20, 2026

Summary

Updates three example apps under packages/sdk/server-ai/examples/ to use the current SDK API, replacing deprecated/removed calls.

Changes:

  • examples/openai/src/index.tsOpenAIProvider.createAIMetricsOpenAIProvider.getAIMetricsFromResponse
  • examples/bedrock/src/index.tsaiClient.config(...)aiClient.completionConfig(...)
  • examples/openai-observability/src/index.ts — migrated from the removed aiConfig.tracker property to the const tracker = aiConfig.createTracker!(); pattern used by the other examples on this branch

No behavioral changes; functional parity with the existing examples.

Test plan

  • Build the affected examples and confirm they type-check against the current feat/ai-sdk-next-release SDK
  • Spot-run openai and openai-observability examples end-to-end to confirm they still emit metrics

🤖 Generated with Claude Code


Note

Low Risk
Low risk because changes are confined to example apps and primarily swap deprecated SDK APIs for current ones without altering core logic or data handling.

Overview
Updates the server-ai examples to match the current SDK surface by switching Bedrock from aiClient.config to aiClient.completionConfig.

Adjusts OpenAI examples to use the newer tracking flow (aiConfig.createTracker()) and the provider metrics extractor OpenAIProvider.getAIMetricsFromResponse, removing reliance on the deprecated/removed aiConfig.tracker and createAIMetrics APIs.

Reviewed by Cursor Bugbot for commit 0a733ce. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25623 bytes
Compressed size limit: 29000
Uncompressed size: 125843 bytes

@github-actions
Copy link
Copy Markdown
Contributor

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

@github-actions
Copy link
Copy Markdown
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 31655 bytes
Compressed size limit: 34000
Uncompressed size: 112792 bytes

@github-actions
Copy link
Copy Markdown
Contributor

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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jsonbailey jsonbailey marked this pull request as ready for review April 20, 2026 17:55
@jsonbailey jsonbailey requested a review from a team as a code owner April 20, 2026 17:55
@jsonbailey jsonbailey merged commit 400d971 into feat/ai-sdk-next-release Apr 20, 2026
44 checks passed
@jsonbailey jsonbailey deleted the jb/aic-1934/update-js-examples branch April 20, 2026 18:06
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.

2 participants