@northflank/js-client 0.10.1 → 0.12.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dist/api-client.d.ts +5833 -744
- package/dist/api-client.js +9 -9
- package/dist/api-client.js.map +1 -1
- package/dist/api-client.mjs +9 -9
- package/dist/api-client.mjs.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -49,6 +49,21 @@ import { ApiClient, ApiClientInMemoryContextProvider } from '@northflank/js-clie
|
|
|
49
49
|
console.log(services.map((svc) => svc.name).join(', '));
|
|
50
50
|
})();
|
|
51
51
|
```
|
|
52
|
+
|
|
53
|
+
For non-persistent Node.js usage, credentials can instead be loaded from the environment:
|
|
54
|
+
|
|
55
|
+
```javascript
|
|
56
|
+
import { ApiClient, ApiClientEnvironmentContextProvider } from '@northflank/js-client';
|
|
57
|
+
|
|
58
|
+
// Reads NF_API_TOKEN or NORTHFLANK_API_TOKEN. NF_API_BASE_URL is optional.
|
|
59
|
+
const contextProvider = new ApiClientEnvironmentContextProvider();
|
|
60
|
+
const apiClient = new ApiClient(contextProvider);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The environment provider never reads or writes the Northflank CLI config file. Its constructor
|
|
64
|
+
throws when no environment token is configured; callers can select a fallback explicitly with
|
|
65
|
+
`ApiClientEnvironmentContextProvider.hasEnvironmentToken()`.
|
|
66
|
+
|
|
52
67
|
If used with Typescript, full typing support can be leveraged.
|
|
53
68
|
|
|
54
|
-
_Supported Node.js versions: 18 or newer_
|
|
69
|
+
_Supported Node.js versions: 18 or newer_
|