VTL Emulator Pro is a browser-based editor and emulator for Apache Velocity Template Language (VTL), designed to simulate AWS API Gateway integration request/response templates.
This tool lets you:
- Write and preview VTL templates live
- Simulate
$input
,$util
, and$context
variables - Render and debug request/response flows
- Manage variables for headers, query params, stage variables, and paths
- Quickly test conditional blocks, loops, and transformations
👉 https://fearlessfara.github.io/apigw-vtl-emulator
This repository contains:
Path | Description |
---|---|
/index.html |
The browser UI HTML entry point |
/script.js |
All the logic powering the editor UI |
/emulator/ |
The standalone VTL engine used by the UI and NPM |
/emulator/tests/ |
Unit tests for the engine |
/img.png |
Screenshot used in documentation |
/CONTRIBUTING.md |
Contribution guide for engine and UI development |
You can contribute to either the visual interface or the evaluation engine.
- 🖊️ Monaco-based editor with syntax highlighting and autocompletion
- 📦 Snippets for common AWS API Gateway use-cases
- 📄 Compare VTL templates side-by-side
- 📥 Import/export template configurations
- 🎨 Light/Dark theme toggle
- 📋 Output preview with copy/share/download support
- 🔍 Debug panel showing render steps
The engine simulates AWS API Gateway’s $input
, $util
, and $context
using velocityjs
, and is available as a
package:
- NPM:
apigw-vtl-emulator
- **CDN (ESM): ** https://cdn.jsdelivr.net/npm/apigw-vtl-emulator@1.0.3/dist/index.mjs
git clone https://github.com/fearlessfara/apigw-vtl-emulator.git
cd apigw-vtl-emulator
open index.html # or use `npx live-server` / `python3 -m http.server`
npm install apigw-vtl-emulator
import {renderVTL} from 'apigw-vtl-emulator';
const output = renderVTL('$input.json("$.name")', {
body: JSON.stringify({name: "Velocity"})
});
console.log(output); // "Velocity"
See CONTRIBUTING.md for full guidelines on contributing to either the UI or engine.
MIT — © 2025 Christian Gennaro Faraone