Local Foundry Emulation

FoundryCI is a Nyrra project that runs Palantir Foundry locally for CI and no-network sandboxes. It emulates the OAuth 2.0, current-user, and compute-module routes Foundry clients depend on, with production-fidelity state instead of mocks. FoundryCI is built on emulate by Vercel Labs, so the same process can also stand in for Vercel, GitHub, Google, Slack, Apple, Microsoft, Okta, AWS, Resend, Stripe, MongoDB Atlas, and Clerk inside your test runs.

Start with Foundry

FoundryCI should get you to local Foundry first, not make you hunt through generic emulate docs. These are the pages to start with:

  • Getting Started shows the fastest path to a local Foundry process, seed config, and a first verification request.
  • Foundry covers the OAuth 2.0 endpoints, current-user lookup, compute-module runtime, and contour job routes.
  • Configuration shows the seed config for users, OAuth clients, deployed apps, and compute-module runtimes.

Bring up the Foundry emulator with npx @nyrra/emulate --service foundry or include foundry: in the seed config. When Foundry runs by itself, its base URL is http://localhost:4000.

If you start multiple services in one process, ports are assigned in the order you pass to --service, starting from the base port. So Foundry is guaranteed to stay on 4000 only when it is the only service, or the first service in the list.

Foundry Quick Start

npx @nyrra/emulate --service foundry

Set FOUNDRY_EMULATOR_URL=http://localhost:4000 when Foundry is running on its own. If you launch more than one service, use the startup banner to see which port Foundry received.

Default Startup Set

The generic multi-service emulate stack is still available. It starts with sensible defaults and keeps Foundry out of the default list unless you opt in:

  • Vercel on http://localhost:4000
  • GitHub on http://localhost:4001
  • Google on http://localhost:4002
  • Slack on http://localhost:4003
  • Apple on http://localhost:4004
  • Microsoft on http://localhost:4005
  • Okta on http://localhost:4006
  • AWS on http://localhost:4007
  • Resend on http://localhost:4008
  • Stripe on http://localhost:4009
  • MongoDB Atlas on http://localhost:4010
  • Clerk on http://localhost:4011

Foundry is available when you enable it explicitly with npx @nyrra/emulate --service foundry or include foundry: in the seed config. The current Foundry slice covers OAuth 2.0, current-user lookup, and compute-module runtime plus contour routes.

CLI

# Start the default startup set
emulate

# Start specific services
emulate --service vercel,github,foundry

# Custom port
emulate --port 3000

# Use a seed config file
emulate --seed config.yaml

# Launch the interactive starter-config builder
emulate init

# Generate config for a specific service
emulate init --service foundry

# Print starter YAML without writing a file
emulate init --service foundry --stdout

# List available services
emulate list

Options

FlagDefaultDescription
-p, --port4000Base port (auto-increments per service)
-s, --servicedefault startup setComma-separated services to enable
--seedauto-detectPath to seed config (YAML or JSON)

The port can also be set via EMULATE_PORT or PORT environment variables.

Programmatic API

You can also use emulate as a library in your tests. See the Programmatic API page for createEmulator, Vitest/Jest setup, and instance methods.

Next.js Integration

Embed emulators directly in your Next.js app so they run on the same origin. See the Next.js Integration page for setup instructions.