-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat(workers): posthog env vars and additional events capture #2466
Conversation
97682d1
to
5052442
Compare
d4fa804
to
69c6ba7
Compare
apiKey: ctx.SECRET_POSTHOG_API_KEY, | ||
properties: { client_id: input.clientId }, | ||
}) | ||
} else if (typeof prevPublished !== 'undefined') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be simplified to else if (appDetails.published)
and remove line 35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if it's not set it'll be underfined which return false in if, so I'll keep it as else is (typeof appDetails.published !== "undefined")
*/ | ||
await posthogCall({ | ||
distinctId: ctx.accountURN as string, | ||
eventName: 'app_unpublished', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set this in a variable from the if
check above, and then make the call using the value of the variable. This way we remove one of the posthostCall
blocks as apart from the eventName
, the other props are exactly the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
edf67a2
to
88514d1
Compare
Description
Modifies middleware to keep track of all routes in workers
Testing
Tested normal behaviour of all apps and then checked all captured events in posthog dashboard
Checklist