fix(core): update

This commit is contained in:
Philipp Kunz 2024-02-17 20:35:46 +01:00
parent ab773c337c
commit e3d80f78fb
2 changed files with 6 additions and 3 deletions

View File

@ -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'
}

View File

@ -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());
}