Merged
Conversation
…date self hosted schemas.
There was a problem hiding this comment.
Pull request overview
Adds support for injecting a CLI user-agent header into outbound requests by introducing a process-wide header store in @powersync/cli-core, then setting it from the CLI entrypoints.
Changes:
- Introduces a global (process-wide) header store and
setCloudClientHeaders()API incli-core. - Injects stored headers into Cloud Management, AccountsHub, and Self-Hosted client request headers.
- Sets
user-agent: POWERSYNC_CLI/<version>from the CLIbin/entrypoints.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/cli-core/src/clients/create-self-hosted-client.ts | Injects shared headers into self-hosted client requests. |
| packages/cli-core/src/clients/create-cloud-client.ts | Adds global header store + setter and injects headers into cloud management requests. |
| packages/cli-core/src/clients/AccountsHubClientSDKClient.ts | Injects shared headers into AccountsHub requests. |
| cli/test/commands/link.test.ts | Adjusts AccountsHub client mocking. |
| cli/src/commands/generate/token.ts | Removes unnecessary await for synchronous cloud client factory. |
| cli/bin/run.js | Sets user-agent header at CLI startup. |
| cli/bin/dev.js | Sets user-agent header in dev entrypoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Chriztiaan
approved these changes
Mar 2, 2026
|
Didn't test, but looks reasonable to me. |
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.
The previous implementation of the CLI passed a
user-agentheader to the PowerSync Management service of the formPOWERSYNC_CLI/${packageVersion}. This adds the same functionality to this implementation.