emulate: The Cloud is Now a Local Process
How vercel-labs/emulate replaces fragile API mocks with a stateful, high-fidelity twin of the modern web stack.
- The tool replaces static JSON mocks with a stateful in-memory relational store that tracks local changes.
- Emulated services replicate production security by generating authentic HMAC-signed webhook payloads.
- Developers can run deterministic integration tests in no-network CI environments without hitting API rate limits.
Beyond the Cardboard Cutout
The local-first movement has conquered databases and frontend development. The cloud, however, remains a black box accessed via fragile API tokens and rate-limited HTTP requests. Standard practice relies on static mocks, which act as cardboard cutouts of real services.
Local drop-in replacement services for CI and no-network sandboxes. Fully stateful, production-fidelity API emulation. Not mocks.
If you create a repository via an API call in emulate, it exists in the local state. A subsequent GET request will return that newly created repository. This turns integration testing from a network-dependent gamble into a deterministic local loop.
The Relational Ghost
The magic lies in a custom in-memory relational store. Every emulator component holds a specific state of the world. It mimics a database with secondary indexes and auto-incrementing IDs without the overhead of a real database.
Cryptographic Fidelity
Beyond data storage, emulate replicates the cryptographic handshake of modern integrations. The GitHub emulator specifically implements webhook delivery logic, including HMAC signing.
When an action occurs, the webhook engine computes the correct signature using the provided secret key. Your local developer server cannot tell the difference between this emulated event and a live production webhook.
The No-Network Sandbox
This architecture is optimized for continuous integration environments where internet access is restricted or rate limits are a bottleneck. Running a single command spins up a comprehensive local cloud environment on predictable ports.
| Feature | Static Mocks | emulate | Live API |
|---|---|---|---|
| Statefulness | None | In-Memory | Persistent |
| Webhook Support | Manual | Automated & Signed | Native |
| Network Required | No | No | Yes |