Skip to content

Validating the posthog connection #372

Open
@aqeelat

Description

Is your feature request related to a problem?

In Node, in order to make sure we don't have an incorrect api key, it would be great if we can have an async function that checks that our sdk was initialized correctly.

Describe the solution you'd like

maybe await (new PostHog(apiKey)).validate(), or await PostHog.build(apiKey, { throwOnError: true })

Describe alternatives you've considered

I tried calling getAllFlags() and reloadFeatureFlags() but they don't throw, and I don't have flags that I can use to check.

Related sub-libraries

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Additional context

Thank you for your feature request – we love each and every one!

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions