Commit ee8d5ff
feat(client): send a rektradar-sdk User-Agent for API attribution
The client only sent Accept (+ optional Authorization), so SDK traffic to
api.rektradar.io was indistinguishable from raw curl / browser fetch / internal
calls in server logs -- we couldn't measure real SDK adoption. Add
`User-Agent: rektradar-sdk/<version>` to every request. In browsers User-Agent
is a forbidden header and is silently dropped (no error); it takes effect in
Node/undici, where real server-side integrations live, so /v1 calls from the
SDK now show up as rektradar-sdk/* in nginx logs. SDK_VERSION is module-local
(not exported) to keep the public api-surface unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent da19371 commit ee8d5ff
2 files changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
32 | 42 | | |
33 | 43 | | |
34 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
14 | 21 | | |
15 | 22 | | |
16 | 23 | | |
| |||
56 | 63 | | |
57 | 64 | | |
58 | 65 | | |
59 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
| |||
0 commit comments