{"repo":"duffelhq/duffel-api-javascript","free":true,"listed":false,"github":"https://github.com/duffelhq/duffel-api-javascript","clone":"git clone https://github.com/duffelhq/duffel-api-javascript.git","description":"JavaScript client library for the Duffel API","language":"TypeScript","stars":55,"topics":["javascript","typescript","nodejs","api","api-client","client-library","flights-api","duffel-api","duffel","travel-api"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Duffel API Javascript Client The Duffel JavaScript client library - sometimes known as an SDK - makes it easy to interact with the Duffel API from your server-side JavaScript applications. Content - Requirements - Installation - Usage - Configuration - Contributing - Documentation Requirements To use the Duffel JavaScript client library, you'll need to be using Node.js v18 (LTS) or later. You can only use the library in server-side JavaScript applications developed in Node.js. It won't work in frontend applications that run in your users' browsers. Usage To get started, import the Duffel module into your code and initialise it using your access token, which you can get from the \"Access tokens\" page in your Duffel dashboard: TypeScript The Duffel JavaScript client library is written in TypeScript and comes with types for Duffel API objects, which you can easily import. Getting a single object As a general rule, you get a single object from the API by its ID. Sometimes, you can pass in optional query parameters: If your request was successful, the get function will return the response body as an object. Inside the data field, you'll find the resource you requested. Expected output from console.log(aircraft) : Errors If there are any errors with your request, the client library will throw an error which you can catch. The error object will expose all of the error information returned by the API. You'll find information about what was wrong in the errors field, and useful context","default_branch":null,"files":null,"tree":[],"storefront":"/r/duffelhq","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/duffelhq/duffel-api-javascript/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}