Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 6416df7

Browse files
kahestjjbayer
andauthored
Add expected User-Agent format to SDK docs (#1222)
* adds user-agent format * adds info about semicolon separator * adds examples for basic user agent * Update src/docs/sdk/overview.mdx Co-authored-by: Joris Bayer <joris.bayer@sentry.io> --------- Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
1 parent bc105e7 commit 6416df7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/docs/sdk/overview.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ We recommend always sending the following headers:
215215

216216
- `content-type`
217217
- `content-length`
218+
- `user-agent`
218219

219220
The following additional headers are permitted as per CORS policy:
220221

@@ -229,6 +230,30 @@ The following additional headers are permitted as per CORS policy:
229230
- `content-encoding`
230231
- `transfer-encoding`
231232

233+
### User Agent
234+
235+
All SDKs are expected to report their name and version via the `user-agent` header.
236+
The following format should be used (unless required or recommended differently by the platform,
237+
e.g. for browser SDKs, where the user agent header must be set by the browser itself):
238+
239+
`{sdk-name}/{sdk-version}`
240+
241+
For example:
242+
- `sentry.python/1.45.0`
243+
- `sentry.php/4.7.0`
244+
- `sentry-ruby/5.17.3`
245+
- `sentry.cocoa/8.24.0`
246+
247+
Additional information about the runtime, operating system, and others can be
248+
appended as comments in parentheses, separated by `; ` (semicolon and space), like so:
249+
250+
`{sdk-name}/{sdk-version} ({runtime-name} {runtime-version}; {os-name} {os-version})`
251+
252+
There is no expectation towards the presence or order of fields. The user agent
253+
must not contain PII or otherwise sensitive data. In general it should not contain
254+
any information that is not already present in the payload.
255+
256+
232257
## Request Compression
233258

234259
SDKs are heavily encouraged to compress the request body before sending it to

0 commit comments

Comments
 (0)