Skip to main content

API Configuration

X21 relies on several external APIs: Anthropic for LLM calls, Langfuse for observability, PostHog for analytics, and Supabase for authentication. Configure each component before deploying the add-in.

Anthropic (Claude)

  • Location – Stored in appsettings.json for the VSTO add-in and environment variables for the Deno server.
  • Required Keys
    • AnthropicApiKey
    • Optional: AnthropicApiUrl if using a proxy or gateway.
  • Usage – The Deno orchestrator reads ANTHROPIC_API_KEY and initialises the SDK via createAnthropicClient(). Ensure the key has access to Claude Sonnet 4.5.

Langfuse

  • Purpose – Trace conversations, tool calls, scores, and feedback.
  • Configuration
    • LANGFUSE_SECRET_KEY
    • LANGFUSE_PUBLIC_KEY
    • LANGFUSE_BASE_URL (defaults to https://cloud.langfuse.com)
    • LANGFUSE_TRACING_ENVIRONMENT (e.g., development, staging, production)
  • If keys are missing, tracing gracefully degrades to a no-op with console warnings.

PostHog

  • Purpose – Front-end and add-in analytics.
  • Configuration
    • UI uses posthog.ts with phc_... key and host https://eu.i.posthog.com.
    • VSTO uses PostHogService with the same key to align events.
  • Consider using environment-specific project keys to separate Dev vs Production telemetry.

Supabase

  • Purpose – Authentication and optional user profile storage.
  • Configuration
    • supabaseUrl and supabaseAnonKey in supabaseClient.ts.
    • Enable PKCE flow (already configured) for secure token exchange.
  • Adjust redirect URLs and email templates in the Supabase dashboard to match your domain.

Localhost Services

  • The VSTO add-in exposes its API on a dynamic port (ExcelApiConfigService) and records it in %LOCALAPPDATA%\X21\excel-api-port-*.txt.
  • The Deno server writes HTTP and WebSocket ports to deno-server-port-*.txt and deno-websocket-port-*.txt. Ensure file paths are accessible to all components.

Deployment Checklist

  1. Populate appsettings.json with production keys. Do not commit this file to source control.
  2. Set matching environment variables for the Deno service in your deployment script or installer.
  3. Verify API connectivity by running the add-in in Dev mode and checking the logs for successful connections.
  4. For air-gapped environments, configure proxies or on-prem deployments of Langfuse/PostHog as needed.
With the APIs configured, X21 can authenticate users, communicate with Claude, and capture rich telemetry for troubleshooting.