chore: update deprecated API usage in server-ai examples#1294
Merged
jsonbailey merged 2 commits intofeat/ai-sdk-next-releasefrom Apr 20, 2026
Merged
chore: update deprecated API usage in server-ai examples#1294jsonbailey merged 2 commits intofeat/ai-sdk-next-releasefrom
jsonbailey merged 2 commits intofeat/ai-sdk-next-releasefrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
@launchdarkly/js-sdk-common size report |
Contributor
|
@launchdarkly/browser size report |
Contributor
|
@launchdarkly/js-client-sdk size report |
Contributor
|
@launchdarkly/js-client-sdk-common size report |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
joker23
approved these changes
Apr 20, 2026
jsonbailey
added a commit
that referenced
this pull request
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ts—OpenAIProvider.createAIMetrics→OpenAIProvider.getAIMetricsFromResponseexamples/bedrock/src/index.ts—aiClient.config(...)→aiClient.completionConfig(...)examples/openai-observability/src/index.ts— migrated from the removedaiConfig.trackerproperty to theconst tracker = aiConfig.createTracker!();pattern used by the other examples on this branchNo behavioral changes; functional parity with the existing examples.
Test plan
feat/ai-sdk-next-releaseSDKopenaiandopenai-observabilityexamples 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-aiexamples to match the current SDK surface by switching Bedrock fromaiClient.configtoaiClient.completionConfig.Adjusts OpenAI examples to use the newer tracking flow (
aiConfig.createTracker()) and the provider metrics extractorOpenAIProvider.getAIMetricsFromResponse, removing reliance on the deprecated/removedaiConfig.trackerandcreateAIMetricsAPIs.Reviewed by Cursor Bugbot for commit 0a733ce. Bugbot is set up for automated code reviews on this repo. Configure here.