Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible improvements? #23

Open
craigpastro opened this issue Sep 7, 2023 · 1 comment
Open

Possible improvements? #23

craigpastro opened this issue Sep 7, 2023 · 1 comment

Comments

@craigpastro
Copy link

craigpastro commented Sep 7, 2023

👋 Hello!

I am trying out PostHog, and I wanted to use PostHog feature flags via OpenFeature, so I wrote a PostHog provider for OpenFeature. (You can find it https://github.com/craigpastro/posthog-openfeature-provider-go if you are interested 🙂 )

Basically, the provider simply wraps IsFeatureEnabled. During the writing of the provider there were a few things I noticed that I think could be improved and wanted to ask what you thought.

So, these mostly relate to the IsFeatureEnabled method.

  1. The call doesn't error out if the API key is incorrect. It does log "posthog 2023/09/07 15:43:34 ERROR: Error calling /decide/" which is not that useful.
  2. It would be nice if this method returned a boolean.
  3. If the flag doesn't exist we have no way of knowing this and we just get back false. It would be nice to somehow know that the flag doesn't exist.
  4. Every request logs "posthog 2023/09/07 15:04:36 ERROR: Unable to fetch feature flags%!(EXTRA )", but I am not sure why.
  5. Not exactly related to IsFeatureEnabled, but if I simply specify a non-empty personal API key when constructing the client, this request succeeds. So is the personal API key actually required?

Thank you for your time! If there are some things you think we can improve I would be happy to try to create a PR.

@lita
Copy link

lita commented Nov 3, 2023

I also been having the same issues as above ^^^ also find it frustrating that i cannot get the payload of the feature flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants