Skip to content

Set User-Agent header #8419

@gr2m

Description

@gr2m

Setting a custom user agent is considered best practice and would help debug problems in case any occur. As far as I can tell, ai is not setting a custom user agent right now.

The user agent should include the most important versions of ai and @ai-sdk/* packages, and user should be able to add their own custom header to it.

Octokit's implementation worked out well over the years:
https://github.com/octokit/core.js/blob/9c425e32f001330786925c0a1d3c47dbcb20103f/test/request.test.ts#L53-L73

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions