Skip to content

feat: initialize SDK providers from configuration#370

Merged
chybisov merged 1 commit intomainfrom
feat/init-providers-from-config
Mar 23, 2026
Merged

feat: initialize SDK providers from configuration#370
chybisov merged 1 commit intomainfrom
feat/init-providers-from-config

Conversation

@chybisov
Copy link
Copy Markdown
Member

Summary

  • Add optional providers field to SDKConfig so providers can be passed directly to createClient() instead of requiring a separate setProviders() call
  • setProviders() continues to work as before, merging by ChainType
  • Added 3 new unit tests covering initialization, merge, and replacement scenarios

Test plan

  • Existing unit tests pass (287 tests across all packages)
  • New tests verify providers initialized from config
  • New tests verify setProviders merges correctly with initial providers
  • New tests verify setProviders replaces initial providers of same type
  • Type checks, linting, circular dependency checks all pass

🤖 Generated with Claude Code

@chybisov chybisov requested a review from effie-ms March 23, 2026 12:42
checkPackageUpdates(name, version)
}

const _config: SDKBaseConfig = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if options include providers now, _config = { ...options } will not be of type SDKBaseConfig? (since it does not have providers)
Should we maybe exclude providers from { ...options }?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be good now 👌

@chybisov chybisov force-pushed the main branch 2 times, most recently from 60cd390 to 1b29bc9 Compare March 23, 2026 13:12
Allow createClient to accept an optional providers array in SDKConfig,
so providers can be set at creation time instead of requiring a
separate setProviders call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@chybisov chybisov force-pushed the feat/init-providers-from-config branch from e9caebb to 2f341a0 Compare March 23, 2026 13:13
@chybisov chybisov merged commit 54a1677 into main Mar 23, 2026
1 of 2 checks passed
@chybisov chybisov deleted the feat/init-providers-from-config branch March 23, 2026 13:30
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