Skip to content

feat: add user agent#7

Merged
stevensJourney merged 136 commits intomainfrom
user-agent
Mar 2, 2026
Merged

feat: add user agent#7
stevensJourney merged 136 commits intomainfrom
user-agent

Conversation

@stevensJourney
Copy link
Collaborator

The previous implementation of the CLI passed a user-agent header to the PowerSync Management service of the form POWERSYNC_CLI/${packageVersion}. This adds the same functionality to this implementation.

Base automatically changed from init to main March 2, 2026 08:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 in cli-core.
  • Injects stored headers into Cloud Management, AccountsHub, and Self-Hosted client request headers.
  • Sets user-agent: POWERSYNC_CLI/<version> from the CLI bin/ 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
Copy link

Didn't test, but looks reasonable to me.

@stevensJourney stevensJourney merged commit b58998e into main Mar 2, 2026
2 checks passed
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.

4 participants