posthog
posthog copied to clipboard
Bug(feature flag): 401 error thrown when using `Feature Flags Secure API key` to local evaluate feature flags
Bug Description
This was reported by a community user here.
I haven't tried reproducing in their environment, but the error message seems distinct enough for me to hunt down the code.
I eventually found the error in posthog-python:
https://github.com/PostHog/posthog-python/blob/3778eaef7b62485f9d389135c0261694cb2d832d/posthog/client.py#L840-L844
It seems like an API error, so I started curling in my localhost, following the instruction here
I used the Feature Flags Secure API key as the POSTHOG_PERSONAL_API_KEY, which started to throw error.
How to reproduce
- Read the docs here
- Write a curl where
POSTHOG_PERSONAL_API_KEYis theFeature Flags Secure API keyfrom here - Fire the curl and this should throw an authentication error.
Additional context
Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables or https://eu.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]