connection issues
This page covers problems connecting twig to PostHog.
authentication failures
"failed to authenticate"
If you can't sign in with PostHog:
- Check your credentials - ensure you're using the correct PostHog account
- Try again - sometimes OAuth flow can timeout; try signing in again
- Check PostHog status - verify PostHog is operational at status.posthog.com
browser doesn't open
If clicking "sign in" doesn't open your browser:
- Try copying the auth URL manually (if shown)
- Open it in your default browser
- Complete the sign in and return to twig
wrong account
If you signed in with the wrong PostHog account:
- Go to twig settings > PostHog
- Click "disconnect"
- Sign in again with the correct account
project access issues
"project not found" or no projects shown
If your projects don't appear:
- Check your PostHog account - make sure you have at least one project
- Check permissions - you need at least read access to see projects
- Check organization - you might be looking at the wrong organization
"permission denied" when querying data
If the agent can't access your analytics:
- Verify you have access to the project in PostHog directly
- Check that you selected the correct project in twig settings
- Try disconnecting and reconnecting to PostHog
network problems
timeouts
If requests are timing out:
- Check your internet connection
- Check if PostHog is accessible at app.posthog.com
- 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:
- Ensure it's correctly configured in system preferences > network
- 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:
- Go to settings > PostHog
- Click "disconnect"
- 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:
- Check that your instance is accessible from your machine
- Verify the API endpoints are available
- Check GitHub issues for self-hosted support status
verifying the connection
To test if your connection is working:
- Open the agent chat
- Ask: "how many events were recorded today?"
- If you get a number, the connection is working
- If you get an error, note the error message for troubleshooting
still stuck?
If connection issues persist:
- Check the twig logs for specific error messages
- Search GitHub issues for similar problems
- 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