Skip to content

Commit 700f996

Browse files
committed
feat: user agent
1 parent ce2aa29 commit 700f996

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/FeatureProbe.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { TinyEmitter } from 'tiny-emitter';
33
import { Base64 } from 'js-base64';
44
import { FPUser } from './FPUser';
55

6+
const PKG_VERSION = require("../package.json").version;
7+
const USER_AGENT = "Js/" + PKG_VERSION;
8+
69
const EVENTS = {
710
READY: 'ready',
811
ERROR: 'error',
@@ -212,6 +215,7 @@ class FeatureProbe extends TinyEmitter {
212215
headers: {
213216
Authorization: this.clientSdkKey,
214217
'Content-Type': 'application/json',
218+
'User-Agent': USER_AGENT,
215219
},
216220
})
217221
.then((response) => {
@@ -251,6 +255,7 @@ class FeatureProbe extends TinyEmitter {
251255
headers: {
252256
Authorization: this.clientSdkKey,
253257
'Content-Type': 'application/json',
258+
'User-Agent': USER_AGENT,
254259
},
255260
body: JSON.stringify(payload),
256261
});

0 commit comments

Comments
 (0)