You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+29-29Lines changed: 29 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,9 +21,9 @@ npm install amadeus --save
21
21
To make your first API call, you will need to [register](https://developers.amadeus.com/register) for an Amadeus Developer Account and [set up your first application](https://developers.amadeus.com/my-apps).
22
22
23
23
```js
24
-
var Amadeus =require('amadeus');
24
+
constAmadeus=require('amadeus');
25
25
26
-
var amadeus =newAmadeus({
26
+
constamadeus=newAmadeus({
27
27
clientId:'REPLACE_BY_YOUR_API_KEY',
28
28
clientSecret:'REPLACE_BY_YOUR_API_SECRET'
29
29
});
@@ -50,7 +50,7 @@ The client can be initialized directly.
50
50
51
51
```js
52
52
// Initialize using parameters
53
-
var amadeus =newAmadeus({
53
+
constamadeus=newAmadeus({
54
54
clientId:'REPLACE_BY_YOUR_API_KEY',
55
55
clientSecret:'REPLACE_BY_YOUR_API_SECRET'
56
56
});
@@ -59,15 +59,15 @@ var amadeus = new Amadeus({
59
59
Alternatively, it can be initialized without any parameters if the environment variables `AMADEUS_CLIENT_ID` and `AMADEUS_CLIENT_SECRET` are present.
60
60
61
61
```js
62
-
var amadeus =newAmadeus();
62
+
constamadeus=newAmadeus();
63
63
```
64
64
65
65
Your credentials can be found on the [Amadeus dashboard](https://developers.amadeus.com/my-apps).
66
66
67
67
By default, the SDK environment is set to `test` environment. To switch to a `production` (pay-as-you-go) environment, please switch the hostname as follows:
amadeus.client.post('/v1/shopping/flight-offers/pricing', JSON.stringify({ data }));
107
+
amadeus.client.post('/v1/shopping/flight-offers/pricing', { data });
108
108
```
109
109
110
110
## Promises
@@ -152,7 +152,7 @@ If a page is not available, the response will resolve to `null`.
152
152
The SDK makes it easy to add your own logger that is compatible with the default `console`.
153
153
154
154
```js
155
-
var amadeus =newAmadeus({
155
+
constamadeus=newAmadeus({
156
156
clientId:'REPLACE_BY_YOUR_API_KEY',
157
157
clientSecret:'REPLACE_BY_YOUR_API_SECRET',
158
158
logger:newMyConsole()
@@ -162,7 +162,7 @@ var amadeus = new Amadeus({
162
162
Additionally, to enable more verbose logging, you can set the appropriate level on your own logger. The easiest way would be to enable debugging via a parameter during initialization, or using the `AMADEUS_LOG_LEVEL` environment variable. The available options are `silent` (default), `warn`, and `debug`.
0 commit comments