feat(http): auto User-Agent + custom-headers override#27
Merged
Conversation
Every outbound HTTP request now carries an auto-generated User-Agent identifying the language, package version, and platform. Each binding crate (Python, Node, Ruby) supplies its own ClientInfo so the User-Agent matches the package the caller installed, not the underlying Rust core. HttpConfig also gains an optional headers map. Caller-supplied headers override every SDK-managed header (User-Agent, x-api-key, Accept, Content-Type) — docblocks call this out explicitly. Ruby additionally gets QuicknodeSdk::SDK.from_config so it matches the Python/Node explicit-config surface and can set headers without going through env vars.
AlejandroFabianCampos
approved these changes
May 27, 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
User-Agentof the formquicknode-sdk-<lang>/<sdk-version> (<os>-<arch>; <lang>-<runtime-version>). Each binding (Python, Node, Ruby) supplies its ownClientInfoso the user agent identifies the package the caller actually installed — npm 3.x.y, PyPI a27, gem alpha.27, etc. — not the underlying Rust core.HttpConfiggains an optionalheadersmap. Caller-supplied headers override every SDK-managed header (User-Agent,x-api-key,Accept,Content-Type); docblocks call this out explicitly. Maximum flexibility — trust the caller.QuicknodeSdk::SDK.from_config(opts)so it matches the Python/Node explicit-config surface and can set headers without env vars.these are the exact strings for default user-agent header the SDK will use on Apple Silicon macOS (darwin/aarch64), built against the current 0.1.0-alpha.27 train. The is the language-package version,
not the Rust core version.
On Linux x86_64 the platform segment changes to linux-x86_64; on aarch64 Linux it's linux-aarch64. Those values come from std::env::consts::{OS, ARCH} in the core crate, so the binding language
doesn't affect them.
Custom header override examples
Rust
Python
Node
Ruby
Fixes DX-5042
Fixes DX-5302
Test plan
cargo check && just lint && just test(203 unit tests pass; new tests cover default UA shape, language-binding UA shape, custom-header overrides, invalid header name/value, and a wiremock test asserting both UA and custom headers reach the wire)just python-build(stubs regenerated with the newheadersparameter)just node-build(index.d.tsregenerated with the newheadersfield; existing test suite passes)just ruby-build(smoke-testedQuicknodeSdk::SDK.from_config(api_key:, http: { headers: ... })constructs cleanly)QN_API_KEYset:cargo run --example admin_e2e -p quicknode-sdk --features rustuv run python/examples/admin.pycd npm && npx tsx examples/admin.tsruby ruby/examples/admin_e2e.rbUser-Agentshape after a release.