diff --git a/src/utils/httpClient.ts b/src/utils/httpClient.ts index dab5e04..7b50280 100644 --- a/src/utils/httpClient.ts +++ b/src/utils/httpClient.ts @@ -5,6 +5,7 @@ import { InvalidRequestError, VideodbError, } from '@/utils/error'; +import { SDK_CLIENT_HEADER } from '@/version'; import axios, { AxiosError, AxiosHeaders, @@ -29,6 +30,7 @@ export class HttpClient { baseURL, headers: { 'x-access-token': apiKey, + 'x-videodb-client': SDK_CLIENT_HEADER, }, timeout: HttpClientDefaultValues.timeout, }); diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..df1be25 --- /dev/null +++ b/src/version.ts @@ -0,0 +1,4 @@ +import { version } from '../package.json'; + +export const SDK_VERSION = version; +export const SDK_CLIENT_HEADER = `videodb-node/${version}`; diff --git a/tsconfig.json b/tsconfig.json index 7afd7ce..a7847bc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -44,6 +44,7 @@ /* Module Resolution Options */ "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, + "resolveJsonModule": true /* Include modules imported with .json extension. */, // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */