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.

vercel-labs/emulate

A giant mechanical clockwork model of the GitHub logo on a workbench, with a developer plugging a USB cable into it, illustrating a local mechanical twin of a cloud service.
Unlike static JSON mocks, emulate acts as a stateful, mechanical twin of the real cloud service.

Key Takeaways

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.

How a single POST request updates the shared in-memory store, instantly reflecting in subsequent GET requests.

Cryptographic Fidelity

Beyond data storage, emulate replicates the cryptographic handshake of modern integrations. The GitHub emulator specifically implements webhook delivery logic, including HMAC signing.

A close-up of a robotic hand stamping a wax seal onto a scroll before handing it over to a human hand.
The webhook engine signs payloads with HMAC, ensuring the local server processes them exactly like production traffic.

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.

FeatureStatic MocksemulateLive API
StatefulnessNoneIn-MemoryPersistent
Webhook SupportManualAutomated & SignedNative
Network RequiredNoNoYes