This project now gives you two ways to test TripJack hotel APIs:
supabase/functions/tripjack-hotel-proxy/index.tsThis is the Supabase Edge Function version.supabase/functions/tripjack-playground/index.tsThis serves a browser UI that calls the proxy edge function.tripjack-local-proxy.mjsThis is the Docker-free local proxy you can run directly with Node.
-
Create your env file:
cp .env.example .env
-
Put your TripJack API key in
.env. -
Run the local proxy:
npm run local -
Send requests to:
http://127.0.0.1:8787/tripjack-hotel-proxy
Do not edit the server code. Just pass a different endpoint in the request body.
Default endpoint:
{
"endpoint": "/hotel-searchquery-list"
}Another example:
{
"endpoint": "/hotel-details",
"payload": {
"id": "hsid9178304060-M184"
}
}You can also change the method if needed:
{
"endpoint": "/some-endpoint",
"method": "POST",
"payload": {}
}This example hits the default hotel search endpoint:
curl -i --request POST 'http://127.0.0.1:8787/tripjack-hotel-proxy' \
--header 'Content-Type: application/json' \
--data '{
"endpoint": "/hotel-searchquery-list",
"payload": {
"searchQuery": {
"checkinDate": "2025-05-10",
"checkoutDate": "2025-05-12",
"roomInfo": [
{
"numberOfAdults": 2,
"numberOfChild": 0
}
],
"searchCriteria": {
"city": "110203",
"nationality": "106",
"currency": "INR"
}
},
"sync": false
}
}'If you want the full local Supabase stack with Studio and the Edge Function:
-
Make sure Docker is running.
-
Create the function env file:
cp supabase/functions/.env.example supabase/functions/.env
-
Put your real TripJack API key in
supabase/functions/.env. -
Start everything:
npm run supabase:local
That script runs:
supabase startsupabase functions serve --env-file supabase/functions/.env
Local URLs:
- Supabase API:
http://127.0.0.1:54321 - Edge Function:
http://127.0.0.1:54321/functions/v1/tripjack-hotel-proxy - Playground UI:
http://127.0.0.1:54321/functions/v1/tripjack-playground - Studio UI:
http://127.0.0.1:54323
Use the same request shape as the Node proxy:
{
"endpoint": "/hotel-searchquery-list",
"method": "POST",
"payload": {}
}Example:
curl --request POST 'http://127.0.0.1:54321/functions/v1/tripjack-hotel-proxy' \
--header 'Content-Type: application/json' \
--data '{
"endpoint": "/hotel-details",
"payload": {
"id": "hsid9178304060-M184"
}
}'If you want a browser UI instead of curl, open:
http://127.0.0.1:54321/functions/v1/tripjack-playgroundThat page lets you:
- change the TripJack endpoint every time
- switch method
- paste any JSON payload
- send the request through the
tripjack-hotel-proxyedge function - inspect the raw response
TRIPJACK_API_URL defaults to https://apitest.tripjack.com/hms/v1. If your TripJack hotel environment uses a different base URL, update .env or supabase/functions/.env.