diff --git a/client.ts b/client.ts index 0e00738..481a4a0 100644 --- a/client.ts +++ b/client.ts @@ -211,8 +211,6 @@ export class OpenFgaClient extends BaseAPI { this.configuration = new ClientConfiguration(configuration); } this.configuration.isValid(); - - this.api = new OpenFgaApi(this.configuration, axios); this.storeId = configuration.storeId; this.authorizationModelId = configuration.authorizationModelId; diff --git a/configuration.ts b/configuration.ts index 36fb0ce..fefb380 100644 --- a/configuration.ts +++ b/configuration.ts @@ -186,10 +186,9 @@ export class Configuration { * @throws {FgaValidationError} */ public isValid(): boolean { - if (!this.apiUrl) { - assertParamExists("Configuration", "apiScheme", this.apiScheme); - assertParamExists("Configuration", "apiHost", this.apiHost); - } + if (!this.apiUrl && !this.apiHost) { + assertParamExists("Configuration", "apiUrl", this.apiUrl); + } if (!isWellFormedUriString(this.getBasePath())) { throw new FgaValidationError(