From 7074cc7478f0bf26f7d401282b203bfd3e76d48c Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Thu, 21 Dec 2023 16:43:12 +0100 Subject: [PATCH] feat: Set SDK version inside user agent header --- src/Doczilla.ts | 2 ++ tsconfig.json | 1 + 2 files changed, 3 insertions(+) diff --git a/src/Doczilla.ts b/src/Doczilla.ts index c76f0f4..90a48ff 100644 --- a/src/Doczilla.ts +++ b/src/Doczilla.ts @@ -3,6 +3,7 @@ import axios, { Axios } from 'axios' import { PdfService } from './services/PdfService' import { ScreenshotService } from './services/ScreenshotService' import { WebhookService } from './services/WebhookService' +import { version } from '../package.json' interface DoczillaOptions { baseURL?: string @@ -20,6 +21,7 @@ export default class Doczilla { this.client = axios.create({ baseURL: options.baseURL || 'https://api.doczilla.app', headers: { + 'User-Agent': `Doczilla Node.js / ${version}`, Authorization: `Bearer ${token}` } }) diff --git a/tsconfig.json b/tsconfig.json index e99c5cc..7204083 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "outDir": "dist", "rootDir": "src/", "moduleResolution": "node", + "resolveJsonModule": true, "typeRoots": [ "node_modules/@types" ]