From e3d80f78fbad9a1f0db79b46f3f508343d2b9bbe Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Sat, 17 Feb 2024 20:35:46 +0100 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/classes.platformclient.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index ac117ef..75e4082 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@serve.zone/platformclient', - version: '1.0.2', + version: '1.0.3', description: 'a module that makes it really easy to use the serve.zone platform inside your app' } diff --git a/ts/classes.platformclient.ts b/ts/classes.platformclient.ts index 742e035..9ee83b8 100644 --- a/ts/classes.platformclient.ts +++ b/ts/classes.platformclient.ts @@ -11,11 +11,14 @@ export class SzPlatformClient { public emailConnector = new SzEmailConnector(this); public smsConnector = new SzSmsConnector(this); - constructor(authorizationStringArg: string) { + constructor(authorizationStringArg?: string) { this.authorizationString = authorizationStringArg; } - public async init() { + public async init(authorizationStringArg?: string) { + if (authorizationStringArg) this.authorizationString = authorizationStringArg; + if (!this.authorizationString) this.authorizationString = process.env.SERVEZONE_PLATFROM_AUTHORIZATION; + if (!this.authorizationString) throw new Error('authorizationString is required'); this.typedsocket = await plugins.typedsocket.TypedSocket.createClient(this.typedrouter, await this.getConnectionAddress()); }