Skip to content

Optional clientName for tools built on the SDK - #15

Merged
vernu merged 1 commit into
mainfrom
feat/client-name
Nov 15, 2026
Merged

vernu merged 1 commit into
mainfrom
feat/client-name

Conversation

@vernu

@vernu vernu commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Tools and integrations built on the SDK can pass clientName (for example my-app/1.2.0). It goes ahead of the SDK's own name in the client headers. An invalid value throws a TypeError in the constructor. The README documents the option.

🤖 Generated with Claude Code

https://claude.ai/code/session_017B6pTTFVhKWwcKLit7MEdz

Summary by CodeRabbit

  • New Features
    • Added an optional clientName setting to identify a published tool or integration in request headers, ahead of the SDK identifier.
    • Invalid client names now produce a TypeError; omitting the setting preserves the existing SDK identifier.

Tools and integrations that wrap the SDK can name themselves. The name goes
ahead of the SDK's own name in the client headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017B6pTTFVhKWwcKLit7MEdz
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

TextbeeOptions now accepts an optional clientName. The client validates and resolves it, then uses it before the SDK identifier in the user-agent and x-sdk-client headers.

Changes: Client name configuration and headers

Layer / File(s) Summary
Configure and resolve client name
src/types.ts, src/client.ts, README.md
TextbeeOptions adds optional clientName. The client validates one to four whitespace-separated name/version parts and prepends valid parts to the SDK identifier. The README documents the option and its header format.
Apply client name to request headers
src/client.ts, test/client.test.ts
Both client headers use the resolved identifier. Tests cover trimming, header values, and invalid names.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: Minimal · up to 4ac30

This adds an optional client name that appears before the SDK name in request headers. Existing behavior is unchanged when the option is omitted, and invalid values throw a TypeError. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: an optional clientName option for tools built on the SDK. The summaries confirm that clientName is added to the constructor options, validated, and prefixed to the cli…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: an optional clientName option for tools built on the SDK. The summaries confirm that clientName is added to the constructor options, validated, and prefixed to the client identifier in the user-agent and x-sdk-client headers. The title is specific and matches the objectives.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ec84e8b and 4ac3087.

Files selected for processing: 4

  • README.md
  • src/client.ts
  • src/types.ts
  • test/client.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@vernu
vernu merged commit 025c496 into main Nov 15, 2026
2 checks passed
@vernu vernu mentioned this pull request Nov 15, 2026
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.

1 participant