Mock Alpha

Quick Start

Connect your app to Mock Alpha in five minutes

Quick Start

The fastest way to use Mock Alpha is against a deployed instance — no local setup required. If you want to run Mock Alpha on your own machine or server instead, see Self-Hosting first, then come back here.

Throughout the docs, https://mock-alpha.your-domain.com stands for your Mock Alpha instance URL. Replace it with the URL your team uses (or http://localhost:3000 when self-hosting locally).

1. Create an account

Open your Mock Alpha instance in a browser and click Register. You will be redirected to the dashboard after signing in.

2. Create a project

  1. Create a project (e.g., "My App")
  2. Copy the generated API key from the project settings
  3. Note the project ID from the URL

Projects support multi-user collaboration — invite teammates from the project settings so everyone can manage the same endpoints and scenarios.

3. Connect your app

Two options, from simplest to most automated:

Option A — point your base URL at Mock Alpha

Change your app's API base URL (in your debug/dev build config) to:

https://mock-alpha.your-domain.com/api/mock

and send the API key with every request:

X-Api-Key: <your-api-key>

Your app's request GET /users/123 now becomes GET https://mock-alpha.your-domain.com/api/mock/users/123 and returns whatever scenario you selected in the dashboard. Works on any platform with zero extra code.

Option B — add an interceptor

An interceptor forwards traffic to your real backend, reports the responses to Mock Alpha so endpoints are captured and seeded automatically, and serves the mock response back to your app.

See Client Integration for the underlying protocol if you want to build one for another platform.

4. Seed your first endpoint

If you used Option B, just navigate around your app — endpoints appear in the dashboard automatically as traffic flows.

If you used Option A, seed an endpoint manually with a single request:

curl -X POST https://mock-alpha.your-domain.com/api/collect \
  -H "X-Api-Key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "GET",
    "path": "/users/123",
    "statusCode": 200,
    "responseBody": { "id": "123", "name": "Alex" },
    "serviceName": "my-app"
  }'

The endpoint now exists in the dashboard with a default scenario containing that response.

5. Switch scenarios

Open the endpoint in the dashboard, add scenarios (e.g., error-500, empty-list), and select which one is active. Your app gets the selected response on the next request — no client changes, no redeploys. See Mock Scenarios.

MQTT (optional)

If your instance exposes the MQTT broker, connect with:

  • TCP: mqtt://mock-alpha.your-domain.com:1883
  • WebSocket: ws://mock-alpha.your-domain.com:1884

Use your projectId as the username and apiKey as the password. See MQTT Mock Server for configuration.

On this page