Skip to content

Jishwaah/vamsys-webhook-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vAMSYS Webhook Parser Tool

Small Node.js service that receives incoming webhook events, validates the shared envelope, routes each event to a configured Discord webhook, and sends a formatted Discord embed.

Incoming schema

{
  "event": "pilot.registered",
  "event_id": "evt_wL5zqNECyp",
  "timestamp": "2026-03-25T17:16:31+00:00",
  "airline_id": 123,
  "data": {}
}

Configuration

  1. Copy .env.example to .env
  2. Copy config/discord-routes.example.json to config/discord-routes.json
  3. Copy config/embed-config.example.json to config/embed-config.json
  4. Set a Discord webhook URL for each event you want to forward

Example routing file:

{
  "defaultWebhookUrl": "",
  "events": {
    "pilot.registered": {
      "webhookUrl": "https://discord.com/api/webhooks/your/webhook",
      "username": "VAMSYS Alerts"
    },
    "flight.completed": {
      "webhookUrl": "https://discord.com/api/webhooks/another/webhook",
      "username": "Flight Notifications"
    }
  }
}

All routings in the discord-routes.json file are optional. You can configure as many or as few events as you like. This allows you to specify custom overrides for certain events while using defaultWebhookUrl for the rest.

If an event is not configured and defaultWebhookUrl is empty, the service accepts the request but does not forward it to Discord.

All changes to configuration files require the application to be restarted to take effect.

Endpoints

  • POST /webhooks/vamsys
  • GET /health

If WEBHOOK_SECRET is set, the incoming request must include x-webhook-secret. You may need to configure this as a custom header in your vAMSYS webhook settings.

Monitoring

Sentry reporting is optional. If SENTRY_DSN is set in .env, the app will report captured errors to Sentry. If it is empty, Sentry stays disabled.

Example:

SENTRY_DSN=https://examplePublicKey@o0.ingest.sentry.io/0

When enabled, the app reports:

  • startup configuration failures
  • Discord delivery failures
  • unexpected Express errors
  • unhandled promise rejections
  • uncaught exceptions

Run

npm install
npm run start

Notes

  • Node.js 18.11.0+ is required because the app uses native fetch and the dev script uses node --watch.
  • The first formatter is generic and works from top-level/nested scalar values in data.
  • Once you have the exact event schemas, the embed formatter can be upgraded to produce cleaner event-specific Discord messages.

About

A simple self-hosted tool to parse webhooks from vAMSYS and post them in Discord.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors