![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@revolugo/booking-api-client
Advanced tools
The Revolugo Booking API Client provides convenient access to the Revolugo Booking API from applications written in server-side JavaScript or for browser based applications. This client exposes Typescript types.
See the Revolugo Booking API documentation.
## Getting Started
### Import & Configure
```js
import { ApiClient } from '@revolugo/booking-api-client'
const revolugoApiClient = new ApiClient({
apiEnvironment: Revolugo.Environment.LIVE,
apiKey: '<public-or-private-api-key-here>',
apiVersion: 'v1',
})
| Option | Default | Description |
| ---------------- | -------- | ------------------------------------------------------------ | -------------------- | -------- | -------- | ---------------------------------------------- |
| apiEnvironment
| Required | Target environment for the client (Environment.PRODUCTION \ | Environment.SANDBOX) | apiKey
| Required | Public or Private Api Key provided by Revolugo |
| apiVersion
| Required | Api version |
See the Revolugo Booking API documentation for details about request/reponse data.
const hotelOfferRequest = await revolugoApiClient.hotelOfferRequests.create({
adult_count: 5,
check_in_date: '2021-05-30',
check_out_date: '2021-06-02',
children: '2,8',
latitude: 45.76405021831942,
longitude: 4.835700988769532,
room_count: 3,
source_market: 'FR',
})
Some endpoints require polling to get the complete result. Polling is already handled by the library:
revolugoApiClient.hotelOffers.list(
{
currency: HotelOffersCurrencyEnum.Eur,
hotelOfferRequestId: 'xxxx-xxxx-xxxx-xxxx-xxxx',
},
(err, result) => {
if (err) {
console.log('Error while Polling')
handleError(err)
return
}
if (result.meta.status === 'in-progress') {
console.log('Still Polling')
doSomething(result)
} else {
console.log('Done Polling')
doSomethingElse(result)
}
},
)
FAQs
Javascript Revolugo Booking API Client (browser + server)
The npm package @revolugo/booking-api-client receives a total of 2,127 weekly downloads. As such, @revolugo/booking-api-client popularity was classified as popular.
We found that @revolugo/booking-api-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.