Skip to content

Commit 436072c

Browse files
committed
Add defaultHeaders
1 parent bf67c45 commit 436072c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib/seam/connect/parse-options.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import version from 'src/lib/version.js'
2+
13
import { getAuthHeaders } from './auth.js'
24
import type { ClientOptions } from './client.js'
35
import {
@@ -8,6 +10,11 @@ import {
810

911
const defaultEndpoint = 'https://connect.getseam.com'
1012

13+
const defaultHeaders = {
14+
'seam-sdk-name': 'seamapi/javascript-http',
15+
'seam-sdk-version': version,
16+
}
17+
1118
export type Options = SeamHttpOptions & { publishableKey?: string }
1219

1320
export const parseOptions = (
@@ -23,6 +30,7 @@ export const parseOptions = (
2330
withCredentials: isSeamHttpOptionsWithClientSessionToken(options),
2431
...options.axiosOptions,
2532
headers: {
33+
...defaultHeaders,
2634
...getAuthHeaders(options),
2735
...options.axiosOptions?.headers,
2836
},

0 commit comments

Comments
 (0)