Skip to content

Commit

Permalink
refactor: Simplify Posthog.init() signature
Browse files Browse the repository at this point in the history
In a recent version we updated the body of this function to always return a `Posthog` instance but we forgot to update the type, let's fix that

Originally written by https://github.com/thexeos but I couldn't get his PR to pass CI - secrets are not shared with contributors PRs

Closes #1616

Co-authored by thexeos
  • Loading branch information
rafaeelaudibert committed Feb 3, 2025
1 parent 255fe09 commit 17d7ed8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/posthog-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export class PostHog {
token: string,
config?: OnlyValidKeys<Partial<PostHogConfig>, Partial<PostHogConfig>>,
name?: string
): PostHog | undefined {
): PostHog {
if (!name || name === PRIMARY_INSTANCE_NAME) {
// This means we are initializing the primary instance (i.e. this)
return this._init(token, config, name)
Expand Down

0 comments on commit 17d7ed8

Please sign in to comment.