Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.esperr.com/llms.txt

Use this file to discover all available pages before exploring further.

Recipe PathThis guide corresponds to recipes/google-cloud.

What this integration does

The Google Cloud recipe extracts request context from the incoming HTTP request, calls Esper at POST /api/v1/runtime/mitigation, and either returns a mitigation response or forwards the request onward. Example shape:
const mitigationPayload = {
  ip:
    req.headers["x-forwarded-for"]?.split(",")[0]?.trim() ||
    req.ip ||
    "127.0.0.1",
  user_agent: req.get("user-agent"),
  path: req.path,
  method: req.method,
  google_trace: req.get("x-cloud-trace-context"),
};

Environment variables

  • ESPER_API_KEY
  • ESPER_API_URL

Deploy

cd recipes/google-cloud
gcloud functions deploy esperProxy \
  --gen2 \
  --runtime=nodejs20 \
  --region=us-central1 \
  --source=. \
  --entry-point=esperProxy \
  --trigger-http
Operational FitThis is the closest Google Cloud equivalent to the AWS Lambda recipe. It fits teams already running request handling at a serverless Google Cloud boundary and wanting Esper without introducing a separate always-on service.

Current behavior notes

  • Monitor is the safest place to start.
  • Challenge should return the Esper challenge payload or redirect URL from the runtime decision response.
  • Block should return an immediate deny response from the function boundary.