|
1 | | -# Amadeus Node SDK |
2 | | - |
3 | | -[](https://badge.fury.io/js/amadeus) |
4 | | -[][travis] |
5 | | -[][support] |
6 | | - |
7 | | -Amadeus provides a set of APIs for the travel industry. Flights, Hotels, Locations and more. |
8 | | - |
9 | | -For more details see the [Node documentation](https://developer.amadeus.com/docs/node) on [Amadeus.com](https://developer.amadeus.com). |
10 | | - |
11 | | -## Installation |
12 | | - |
13 | | -This gem requires Node 2.2+. You can install install it directly or via bundler. |
14 | | - |
15 | | -```node |
16 | | -gem install 'amadeus' |
17 | | -``` |
18 | | - |
19 | | -__Next__: [Get Started with the Node SDK.](https://developer.amadeus.com/docs/node/get_started/initialize) |
20 | | - |
21 | | -## Getting Started |
22 | | - |
23 | | -To send make your first API call you will need to [register for an Amadeus Developer Account](https://developer.amadeus.com/register) and [set up your first application](https://dashboard.developer.amadeus.com/applications). |
24 | | - |
25 | | -```node |
26 | | -require 'amadeus' |
27 | | - |
28 | | -amadeus = Amadeus::Client.new({ |
29 | | - client_id: '[YOUR_CLIENT_ID]', |
30 | | - client_secret: '[YOUR_CLIENT_SECRET]' |
31 | | -}) |
32 | | - |
33 | | -amadeus.reference_data.locations.get({ keyword: 'Lon' }) |
34 | | -#=> Returns a list of locations (Airport ad City codes) |
35 | | -# that match this string in some way |
36 | | -``` |
37 | | - |
38 | | -__Next__: [Learn more about Locations](https://developer.amadeus.com/docs/node/get_started/locations) with our Node SDK. |
39 | | - |
40 | | -## Initialization |
41 | | - |
42 | | -The client can be initialized directly or via environment variables. |
43 | | - |
44 | | -```node |
45 | | -# Initialize using parameters |
46 | | -amadeus = Amadeus::Client.new(client_id: '...', client_secret: '...') |
47 | | - |
48 | | -# Alternative: Initialize using environment variables |
49 | | -# * AMADEUS_CLIENT_ID |
50 | | -# * AMADEUS_CLIENT_SECRET |
51 | | -amadeus = Amadeus::Client.new |
52 | | -``` |
53 | | - |
54 | | -Your credentials can be found on the [Amadeus dashboard](https://dashboard.developer.amadeus.com/client_ids). [Sign up](https://developer.amadeus.com/register) for an account today. |
55 | | - |
56 | | -__Next__: [Learn more about our initializing the Node SDK](https://developer.amadeus.com/docs/node/get_started_initialize) in our documentation. |
57 | | - |
58 | | -## Logging & Debugging |
59 | | - |
60 | | -The SDK makes it easy to add your own logger. |
61 | | - |
62 | | -```node |
63 | | -amadeus = Amadeus::Client.new( |
64 | | - client_id: '...', |
65 | | - client_secret: '...', |
66 | | - logger: MyOwnLogger.new |
67 | | -) |
68 | | -``` |
69 | | - |
70 | | -Additionally, to enable more verbose logging, you can set the appropriate level either via a parameter on initialization, or using the `AMADEUS_LOG_LEVEL` environment variable. |
71 | | - |
72 | | -```node |
73 | | -amadeus = Amadeus::Client.new( |
74 | | - client_id: '...', |
75 | | - client_secret: '...', |
76 | | - log_level: 1 # defaults to silent, 0 |
77 | | -) |
78 | | -``` |
79 | | - |
80 | | -## Documentation |
81 | | - |
82 | | -Amadeus has a large set of APIs, and our documentation is here to get you started today. |
83 | | - |
84 | | -* [Get Started](https://developer.amadeus.com/docs/node/get_started) documentation |
85 | | - * [Initialize the SDK](https://developer.amadeus.com/docs/node/get_started/initialize) |
86 | | - * [Find an Airport](https://developer.amadeus.com/docs/node/get_started/find_an_airport) |
87 | | - * [Book a Flight](https://developer.amadeus.com/docs/node/get_started/book_a_flight) |
88 | | - * [Get Flight Inspiration](https://developer.amadeus.com/docs/node/get_started/get_flight_inspiration) |
89 | | - |
90 | | -Alternatively, head over to our [Reference](https://developer.amadeus.com/docs/node/reference) documentaton for in-depth information about every SDK method, it's arguments and return types. |
91 | | - |
92 | | -## License |
93 | | - |
94 | | -This library is released under the [MIT License](LICENSE). |
95 | | - |
96 | | -## Help |
97 | | - |
98 | | -Our [developer support team](https://developer.amadeus.com/developers) is here to help you. You can find us on [Twitter](#), [StackOverflow](#), and [email](#). |
99 | | - |
100 | | -[gem]: https://nodegems.org/gems/amadeus-node |
101 | | -[travis]: http://travis-ci.org/amadeus-node |
102 | | -[support]: http://developer.amadeus.com/support |
0 commit comments