Skip to content

Commit 88bf8c2

Browse files
doc: fix and extend the READMEs (#2)
1 parent 53de909 commit 88bf8c2

2 files changed

Lines changed: 34 additions & 10 deletions

File tree

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,20 @@ npm i --save @ionos-cloud/sdk-nodejs-dbaas-postgres
2020
```
2121

2222
## Usage
23+
Import the SDK using:
2324

24-
```typescript
25+
```javascript
26+
const sdk = require('@ionos-cloud/sdk-nodejs-dbaas-postgres')
27+
```
28+
29+
Or, if the import is done from an ES module, use:
30+
31+
```javascript
32+
import * as sdk from '@ionos-cloud/sdk-nodejs-dbaas-postgres';
33+
```
34+
35+
Usage example:
36+
```javascript
2537
const sdk = require('@ionos-cloud/sdk-nodejs-dbaas-postgres')
2638

2739
const config = new sdk.Configuration({username: 'username_here', password: 'password_here'});
@@ -35,7 +47,7 @@ clustersApi.clustersGet().then((response) => console.log(response));
3547

3648
The username and password or the authentication token can be manually specified when initializing the SDK client:
3749

38-
```typescript
50+
```javascript
3951
const config = new sdk.Configuration({username: 'username_here', password: 'password_here'});
4052
const clustersApi = new sdk.ClustersApi(config);
4153
```
@@ -46,10 +58,10 @@ Environment variables can also be used; the SDK uses the following variables:
4658
* IONOS\_PASSWORD - to specify the password
4759
* IONOS\_TOKEN - if an authentication token is being used
4860

49-
In this case, the client configuration must be initialized using `NewConfigurationFromEnv()`
61+
In this case, the client configuration must be initialized using `fromEnv()`:
5062

51-
```typescript
52-
client := new sdk.ClustersApi(sdk.NewConfigurationFromEnv())
63+
```javascript
64+
const client = new sdk.ClustersApi(sdk.Configuration.fromEnv());
5365
```
5466

5567
{% hint style="danger" %}

docs/README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,20 @@ npm i --save @ionos-cloud/sdk-nodejs-dbaas-postgres
1717
```
1818

1919
## Usage
20+
Import the SDK using:
2021

21-
```typescript
22+
```javascript
23+
const sdk = require('@ionos-cloud/sdk-nodejs-dbaas-postgres')
24+
```
25+
26+
Or, if the import is done from an ES module, use:
27+
28+
```javascript
29+
import * as sdk from '@ionos-cloud/sdk-nodejs-dbaas-postgres';
30+
```
31+
32+
Usage example:
33+
```javascript
2234
const sdk = require('@ionos-cloud/sdk-nodejs-dbaas-postgres')
2335

2436
const config = new sdk.Configuration({username: 'username_here', password: 'password_here'});
@@ -32,7 +44,7 @@ clustersApi.clustersGet().then((response) => console.log(response));
3244

3345
The username and password or the authentication token can be manually specified when initializing the SDK client:
3446

35-
```typescript
47+
```javascript
3648
const config = new sdk.Configuration({username: 'username_here', password: 'password_here'});
3749
const clustersApi = new sdk.ClustersApi(config);
3850
```
@@ -43,10 +55,10 @@ Environment variables can also be used; the SDK uses the following variables:
4355
* IONOS\_PASSWORD - to specify the password
4456
* IONOS\_TOKEN - if an authentication token is being used
4557

46-
In this case, the client configuration must be initialized using `NewConfigurationFromEnv()`
58+
In this case, the client configuration must be initialized using `fromEnv()`:
4759

48-
```typescript
49-
client := new sdk.ClustersApi(sdk.NewConfigurationFromEnv())
60+
```javascript
61+
const client = new sdk.ClustersApi(sdk.Configuration.fromEnv());
5062
```
5163

5264
{% hint style="danger" %}

0 commit comments

Comments
 (0)