Skip to main content
Every request to your Conductor application includes rich location data from Cloudflare’s edge network. Use it for localization, privacy compliance, and intelligent routing.

Overview

The location context is available on every AgentExecutionContext and provides:
  • Geographic data: Country, city, region, coordinates, timezone
  • Jurisdiction detection: GDPR, CCPA, LGPD, and other privacy laws
  • Consent helpers: Check if consent is required for specific purposes
  • Language inference: Detect preferred language from headers or country
  • Timezone utilities: Format times, check business hours

Geographic Data

Access location information extracted from Cloudflare’s edge:

Region Checking

Use isIn() to check if the user is in specific regions or groups:

Available Region Groups

Jurisdiction Detection

Automatically detect which privacy laws apply to the user:

Supported Jurisdictions

Check if consent is required before processing user data:
Get the consent model to use:
The cookies operation integrates directly with location context to automatically enforce consent rules. When you specify a purpose for a cookie, the operation checks if consent is required and granted before setting the cookie.
If a GDPR user hasn’t consented to analytics, the first cookie returns:
Pass user consent from your cookie banner:
See cookies operation for full documentation.

Language Inference

Detect the user’s preferred language:

Language Matching Priority

  1. Accept-Language header - User’s browser preference
  2. Country’s primary language - Fallback based on location
  3. First supported language - Ultimate fallback

Timezone Utilities

Work with the user’s local time:

Smart Scheduling

Real-World Example

A complete example showing consent gating and localization:

TypeScript Types

Import types directly from the package:

Next Steps

Edge Context

Network and infrastructure info

Security

Authentication and authorization

Operations

Available operation types

Creating Agents

Build custom agents