Skip to content
Get Started for Free

App Emulators

App emulators are local simulations of third-party SaaS APIs such as Stripe and Slack. They run inside the LocalStack Pro container, so your application can call them the way it calls the real service, without a vendor account.

App emulators are available to all LocalStack customers.

In this quickstart you start LocalStack, then make the same API calls your app would make to Stripe: create a customer, create a payment intent for that customer and read it back. The Stripe app emulator answers them locally.

How app emulators work

  1. The first request to an app emulator’s hostname downloads its Linux binary from a GitHub release into the container.
  2. LocalStack starts the binary on a local port and waits up to 30 seconds for its health check to pass.
  3. The gateway proxies that request, and every later one, to the running process.

If you never call an app emulator, nothing is downloaded. Each release is built in CI, scanned for known vulnerabilities, published with a software bill of materials, and verified before it is tagged.

  • stripe: stripe.localhost.localstack.cloud
  • resend: resend.localhost.localstack.cloud
  • logo.dev: logodev.localhost.localstack.cloud
  • slack: slack.localhost.localstack.cloud
  • plaid: plaid.localhost.localstack.cloud
  • xero: xero.localhost.localstack.cloud

In-progress being rebuilt to our customer-ready standards:

  • twilio: twilio.localhost.localstack.cloud
  • posthog: posthog.localhost.localstack.cloud
  • Docker and lstk. See Installation.
  • A LocalStack auth token. Run lstk login, or set LOCALSTACK_AUTH_TOKEN. See Auth Token.
  • Network access from the container to GitHub the first time you call each app emulator.
  • curl, or any HTTP client.

Run lstk start. On the first run, lstk opens a browser to log you in. At startup the container maps a hostname for each app emulator.

Terminal window
lstk start
Output
Pulling localstack/localstack-pro:latest...
Preparing LocalStack...
✓ Pulled localstack/localstack-pro:latest
Checking license...
✓ Valid license (Enterprise)
Starting LocalStack...
✓ LocalStack is running (containerId: 6e287e57c450)
• Endpoint: localhost.localstack.cloud:4566
• Web app: https://app.localstack.cloud
> Tip: View emulator logs: lstk logs --follow

App emulators share your LocalStack address. Put the app emulator’s name in front of your LocalStack host. With the default setup, Stripe is at stripe.localhost.localstack.cloud:4566.

Create a customer with the Stripe API, using a test API key such as sk_test_x.

Terminal window
curl -u sk_test_x: -d "email=jenny@example.com" -d "name=Jenny Rosen" http://stripe.localhost.localstack.cloud:4566/v1/customers
Output
{
"id": "cus_000001",
"object": "customer",
"name": "Jenny Rosen",
"email": "jenny@example.com",
"balance": 0,
"delinquent": false,
"livemode": false,
"created": 1794900564
}

The response includes the customer id, which starts with cus_. The first call also installs the Stripe app emulator. In testing, a first call took between 2 and 20 seconds because it downloaded the binary, and later calls were immediate. lstk keeps downloaded app emulators in its volume, so they are not downloaded again after a restart.

Create a payment intent for that customer, passing the customer id from Step 2.

Terminal window
curl -u sk_test_x: -d amount=2000 -d currency=usd -d customer=cus_000001 http://stripe.localhost.localstack.cloud:4566/v1/payment_intents
Output
{
"id": "pi_000001",
"object": "payment_intent",
"amount": 2000,
"amount_received": 0,
"currency": "usd",
"customer": "cus_000001",
"status": "requires_payment_method",
"capture_method": "automatic",
"confirmation_method": "automatic",
"client_secret": "pi_000001_secret_b14b843edf61a58870d3f96f",
"livemode": false,
"created": 1794900570
}

Retrieve the payment intent with the id from Step 3.

Terminal window
curl -u sk_test_x: http://stripe.localhost.localstack.cloud:4566/v1/payment_intents/pi_000001
Output
{
"id": "pi_000001",
"object": "payment_intent",
"amount": 2000,
"amount_received": 0,
"currency": "usd",
"customer": "cus_000001",
"status": "requires_payment_method",
"capture_method": "automatic",
"confirmation_method": "automatic",
"client_secret": "pi_000001_secret_b14b843edf61a58870d3f96f",
"livemode": false,
"created": 1794900570
}

When an AI coding agent cannot reach a third-party API, it usually writes a mock and tests against that, so your code is only checked against the agent’s own guess of the API. With app emulators, the agent calls the same local endpoints you called in this quickstart, and its code runs against an API that answers like the vendor’s.

Your agent needs nothing extra. App emulators are plain HTTP endpoints on your LocalStack host, so any agent that can run curl, a script, or your tests can use them. You do not need an MCP server, a plugin, or a vendor account.

Add an AGENTS.md file to the root of your repository. Many AI coding agents read this file before they start work. Tell the agent which app emulators to use instead of mocks:

AGENTS.md
## Application emulators
This repo tests third-party APIs against LocalStack app emulators.
Start LocalStack with `lstk start` before running code or tests.
Do not mock Stripe. Use the Stripe app emulator at
http://stripe.localhost.localstack.cloud:4566 with the test API key sk_test_x.

If your code uses a vendor SDK, tell the agent to point the SDK at the app emulator’s URL. For example, the Stripe Python and Node.js SDKs both let you override the API host.

The LocalStack for SaaS Applications repository uses this pattern. Its AGENTS.md tells agents to use the app emulators listed in emulators.lock before mocking any of those dependencies.

With LocalStack running, give your agent a prompt like this:

LocalStack is running with the Stripe app emulator at http://stripe.localhost.localstack.cloud:4566.
Write a script that creates a Stripe customer and a 20 USD payment intent for that customer, using the test API key sk_test_x.
Run the script against the app emulator, and fix any errors.

Review agent-generated code before you use it with the real vendor API. For more ways to use LocalStack with AI coding agents, see AI & Agent Workflows.

LocalStack exits with “activation failed”

Section titled “LocalStack exits with “activation failed””

The container needs an auth token. Run lstk login, or set LOCALSTACK_AUTH_TOKEN, then start LocalStack again.

The first call downloads the app emulator, which can take up to about 20 seconds. Later calls do not.

A fresh Stripe app emulator has no data. Create the customer in Step 2 first, and pass the ids it returns.

A call returns 503 “Application not available”

Section titled “A call returns 503 “Application not available””

The response names the app emulator, for example Application stripe not available. The app emulator could not be downloaded or did not start. Check that the container can reach GitHub. LocalStack does not retry within the same run, so restart LocalStack after you fix the network.

Was this page helpful?