fix: remove legacy platform env fallbacks

This commit is contained in:
2026-04-28 12:44:01 +00:00
parent f0b924ba9d
commit df542ec67a
5 changed files with 13 additions and 11 deletions
+5 -1
View File
@@ -1,11 +1,15 @@
# Changelog # Changelog
## 2026-04-28 - 1.1.4 - fix(platformclient)
Keep platform environment configuration clean.
- Kept only `SERVEZONE_PLATFORM_URL`, `SERVEZONE_PLATFORM_AUTHORIZATION`, `SERVEZONE_PLATFORM_TOKEN`, and platform binding discovery.
## 2026-04-28 - 1.1.3 - feat(platformclient) ## 2026-04-28 - 1.1.3 - feat(platformclient)
Add runtime platform binding configuration. Add runtime platform binding configuration.
- Added `SERVEZONE_PLATFORM_URL`, `SERVEZONE_PLATFORM_AUTHORIZATION`, and `SERVEZONE_PLATFORM_TOKEN` support. - Added `SERVEZONE_PLATFORM_URL`, `SERVEZONE_PLATFORM_AUTHORIZATION`, and `SERVEZONE_PLATFORM_TOKEN` support.
- Added environment binding discovery through `SERVEZONE_PLATFORM_BINDING` and `SERVEZONE_PLATFORM_BINDINGS`. - Added environment binding discovery through `SERVEZONE_PLATFORM_BINDING` and `SERVEZONE_PLATFORM_BINDINGS`.
- Preserved `SERVEZONE_API_DOMAIN` and `SERVEZONE_PLATFROM_AUTHORIZATION` fallbacks.
## 2024-10-05 - 1.1.2 - fix(core) ## 2024-10-05 - 1.1.2 - fix(core)
Fix authorization handling and format code. Fix authorization handling and format code.
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@serve.zone/platformclient", "name": "@serve.zone/platformclient",
"version": "1.1.3", "version": "1.1.4",
"private": false, "private": false,
"description": "a module that makes it really easy to use the serve.zone platform inside your app", "description": "a module that makes it really easy to use the serve.zone platform inside your app",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
+3 -3
View File
@@ -43,7 +43,7 @@ await platformClient.emailConnector.sendEmail({
}); });
``` ```
The client connects to the platform endpoint configured through `SERVEZONE_PLATFORM_URL`, a runtime platform binding, or the legacy `SERVEZONE_API_DOMAIN` fallback. The client connects to the platform endpoint configured through `SERVEZONE_PLATFORM_URL` or a runtime platform binding.
## Configuration ## Configuration
@@ -51,8 +51,8 @@ The client needs two values:
| Value | How to provide it | Notes | | Value | How to provide it | Notes |
| --- | --- | --- | | --- | --- | --- |
| Authorization token | Constructor argument, `init()` argument, `SERVEZONE_PLATFORM_AUTHORIZATION`, `SERVEZONE_PLATFORM_TOKEN`, binding credential env, or `SERVEZONE_PLATFROM_AUTHORIZATION` | The misspelled legacy env name remains supported for compatibility. | | Authorization token | Constructor argument, `init()` argument, `SERVEZONE_PLATFORM_AUTHORIZATION`, `SERVEZONE_PLATFORM_TOKEN`, or binding credential env | Loaded on demand through `@push.rocks/qenv`. |
| Platform URL | Constructor options, `SERVEZONE_PLATFORM_URL`, binding endpoint, or `SERVEZONE_API_DOMAIN` | Loaded on demand through `@push.rocks/qenv`. | | Platform URL | Constructor options, `SERVEZONE_PLATFORM_URL`, or binding endpoint | Loaded on demand through `@push.rocks/qenv`. |
| Runtime bindings | Constructor options, `SERVEZONE_PLATFORM_BINDING`, or `SERVEZONE_PLATFORM_BINDINGS` | Values are JSON-encoded `IPlatformBinding` objects from `@serve.zone/interfaces`. | | Runtime bindings | Constructor options, `SERVEZONE_PLATFORM_BINDING`, or `SERVEZONE_PLATFORM_BINDINGS` | Values are JSON-encoded `IPlatformBinding` objects from `@serve.zone/interfaces`. |
```typescript ```typescript
+1 -1
View File
@@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@serve.zone/platformclient', name: '@serve.zone/platformclient',
version: '1.1.3', version: '1.1.4',
description: 'a module that makes it really easy to use the serve.zone platform inside your app' description: 'a module that makes it really easy to use the serve.zone platform inside your app'
} }
+3 -5
View File
@@ -105,9 +105,8 @@ export class SzPlatformClient {
const connectionAddress = const connectionAddress =
this.connectionAddress || this.connectionAddress ||
(await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_URL')) || (await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_URL')) ||
this.getConnectionAddressFromBindings() || this.getConnectionAddressFromBindings();
(await this.getConfiguredEnvVar('SERVEZONE_API_DOMAIN')); if (!connectionAddress) throw new Error('SERVEZONE_PLATFORM_URL or platform binding endpoint is required');
if (!connectionAddress) throw new Error('SERVEZONE_PLATFORM_URL or SERVEZONE_API_DOMAIN is required');
return connectionAddress; return connectionAddress;
} }
@@ -138,8 +137,7 @@ export class SzPlatformClient {
private async getConfiguredAuthorizationString() { private async getConfiguredAuthorizationString() {
return ( return (
(await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_AUTHORIZATION')) || (await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_AUTHORIZATION')) ||
(await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_TOKEN')) || (await this.getConfiguredEnvVar('SERVEZONE_PLATFORM_TOKEN'))
(await this.getConfiguredEnvVar('SERVEZONE_PLATFROM_AUTHORIZATION'))
); );
} }