connection issues

This page covers problems connecting twig to PostHog.

authentication failures

"failed to authenticate"

If you can't sign in with PostHog:

  1. Check your credentials - ensure you're using the correct PostHog account
  2. Try again - sometimes OAuth flow can timeout; try signing in again
  3. Check PostHog status - verify PostHog is operational at status.posthog.com

browser doesn't open

If clicking "sign in" doesn't open your browser:

  1. Try copying the auth URL manually (if shown)
  2. Open it in your default browser
  3. Complete the sign in and return to twig

wrong account

If you signed in with the wrong PostHog account:

  1. Go to twig settings > PostHog
  2. Click "disconnect"
  3. Sign in again with the correct account

project access issues

"project not found" or no projects shown

If your projects don't appear:

  1. Check your PostHog account - make sure you have at least one project
  2. Check permissions - you need at least read access to see projects
  3. Check organization - you might be looking at the wrong organization

"permission denied" when querying data

If the agent can't access your analytics:

  1. Verify you have access to the project in PostHog directly
  2. Check that you selected the correct project in twig settings
  3. Try disconnecting and reconnecting to PostHog

network problems

timeouts

If requests are timing out:

  1. Check your internet connection
  2. Check if PostHog is accessible at app.posthog.com
  3. Check for VPN or firewall issues

corporate network/firewall

If you're behind a corporate firewall:

Twig needs to connect to:

  • app.posthog.com (PostHog API)
  • api.anthropic.com (AI agent)

Ask your IT team to allow these domains if they're blocked.

proxy configuration

Twig uses your system proxy settings. If you use a proxy:

  1. Ensure it's correctly configured in system preferences > network
  2. Check that your proxy allows connections to PostHog

token expiration

PostHog OAuth tokens can expire. If you were working and suddenly can't access data:

  1. Go to settings > PostHog
  2. Click "disconnect"
  3. Sign in again to get a fresh token

api limits

If you see rate limiting errors:

  • PostHog has API rate limits
  • Reduce the frequency of data queries
  • Wait a few minutes and try again

eu vs us hosting

PostHog has both US and EU hosting. Make sure twig connects to the right one:

  • If your PostHog account is on eu.posthog.com, ensure twig is configured for EU
  • Check your PostHog URL to determine which region you're on

self-hosted posthog

Twig currently supports PostHog Cloud. Self-hosted instances may have limited support.

If you're using self-hosted PostHog:

  1. Check that your instance is accessible from your machine
  2. Verify the API endpoints are available
  3. Check GitHub issues for self-hosted support status

verifying the connection

To test if your connection is working:

  1. Open the agent chat
  2. Ask: "how many events were recorded today?"
  3. If you get a number, the connection is working
  4. If you get an error, note the error message for troubleshooting

still stuck?

If connection issues persist:

  1. Check the twig logs for specific error messages
  2. Search GitHub issues for similar problems
  3. Create a new issue with:
    • The error message you're seeing
    • Your PostHog hosting (Cloud US, Cloud EU, or self-hosted)
    • Steps you've already tried