From 3d63f6224151af7ed3998971f1c9cdc17f17f73e Mon Sep 17 00:00:00 2001 From: Tristan Camejo Date: Sun, 25 Dec 2022 17:38:45 +1100 Subject: [PATCH] feat(clients): auth --- clients/js/package.json | 2 +- clients/js/src/Client.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/js/package.json b/clients/js/package.json index 0a783c8..b8bfdd9 100644 --- a/clients/js/package.json +++ b/clients/js/package.json @@ -1,6 +1,6 @@ { "name": "elytra", - "version": "1.0.0", + "version": "1.1.0", "main": "dist/index.js", "types": "dist/index.d.ts", "author": "Tristan Camejo ", diff --git a/clients/js/src/Client.ts b/clients/js/src/Client.ts index eb3ce58..e580508 100644 --- a/clients/js/src/Client.ts +++ b/clients/js/src/Client.ts @@ -5,6 +5,7 @@ import { LangService } from "./services/LangService"; export interface ClientOptions { apiRoot: string; lang?: string; + token?: string; } export interface ClientResponse { @@ -37,6 +38,7 @@ export class Client { method, headers: { "Content-Type": "application/json", + Authorization: this.options.token || "", }, body: JSON.stringify(body), });