Skip to content

Commit c7f6d58

Browse files
Merge pull request #7 from contentstack/feat/DX-554-x-user-agent
feat: added x-user-agent in headers
2 parents f2ea9dc + 68444f4 commit c7f6d58

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/contentstack.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Policy, StackConfig } from './types';
66
import { getHost } from './utils';
77
export * as Utils from '@contentstack/utils';
88

9+
let version = '{{VERSION}}';
10+
911
/**
1012
* @method stack
1113
* @memberof Contentstack
@@ -71,6 +73,8 @@ export function stack(config: StackConfig): StackClass {
7173
defaultConfig.headers['x-header-ea'] = config.early_access.join(',');
7274
}
7375

76+
defaultConfig.headers['X-User-Agent'] = 'contentstack-delivery-typescript-{{PLATFORM}}/' + version;
77+
7478
// return new Stack(httpClient(defaultConfig), config);
7579
const client = httpClient(defaultConfig as any);
7680

0 commit comments

Comments
 (0)