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

posthog.project_api_key doesn't work #31

Closed
philipdouglas opened this issue May 18, 2021 · 6 comments · Fixed by #32
Closed

posthog.project_api_key doesn't work #31

philipdouglas opened this issue May 18, 2021 · 6 comments · Fixed by #32
Assignees

Comments

@philipdouglas
Copy link

According to the docs (https://posthog.com/docs/libraries/python#installation) posthog.api_key has been deprecated in favour of posthog.project_api_key.

However, when I use project_api_key with the current version, 1.3.1, it does not work, while api_key does.

@yakkomajuri
Copy link
Contributor

Hey! Are you by any chance passing both of them? Or do you have only project_api_key and it still doesn't work?

@neilkakkar neilkakkar self-assigned this May 18, 2021
@neilkakkar
Copy link
Contributor

neilkakkar commented May 18, 2021

Just tried this out, just project_api_key doesn't work, and when both are set, we still give precedence to api_key. Thanks for pointing this out, @FreakyDug , will fix!

@philipdouglas
Copy link
Author

Yeah, I was only setting project_api_key. Thanks for the quick response!

@Twixes
Copy link
Member

Twixes commented May 18, 2021

This may be because actually in most places we still left api_key (only the Client class got updated really) – __init__.py being one example. To fully deprecate api_key we need to change all of its occurrences to project_api_key (danger: this will be a user-facing API change unless we go to pretty extreme lengths to maintain the same getter/setter behavior for project_api_key and api_key everywhere).

@Twixes
Copy link
Member

Twixes commented May 18, 2021

Alright, so we've released a new version of the library, which should work as expected here. Please give it a try @FreakyDug!

@philipdouglas
Copy link
Author

That fixed it, thanks @Twixes! Very fast work!

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

Successfully merging a pull request may close this issue.

4 participants