feat: add wizard state push#463
Conversation
gewenyu99
left a comment
There was a problem hiding this comment.
Some shape smells I wanted to point out.
Btw, this goes in after you in-app stack, correct? I can facilitate a release :D
There was a problem hiding this comment.
Can you also delete the local file destination while you're at it? It was a placeholder for testing while we waited for this :)
| | { kind: 'oauth_session'; token: string } | ||
| | { kind: 'personal_api_key'; key: string }; | ||
|
|
||
| export interface PostHogCredentials { |
There was a problem hiding this comment.
This feels like a duplicate of type { Credentials } from wizard-session
|
|
||
| function authHeader(auth: PostHogAuth): string { | ||
| return auth.kind === 'personal_api_key' | ||
| ? `Bearer ${auth.key}` |
There was a problem hiding this comment.
Wait these look the same. Do we need this helper?
| return { | ||
| host: creds.host, | ||
| projectId: creds.projectId, | ||
| auth: { kind: 'oauth_session', token: creds.accessToken }, |
There was a problem hiding this comment.
I know the our Wizard session is a bit of a mess rn (sorry we need spring cleaning :kek:), but this should be getting credentials from the Wizard session (in wizard-session.ts). This is where it's stored already I'm pretty sure.
We also don't need to care if it's oauth_session or another type. The bearer token shape we send through the API is identical.
Problem
We will integrate the wizard with PostHog backend, so we can sync the wizard state with the onboarding.
Changes
I'm piggybacking on the task stream push system, adding a new PostHog destination.
Test plan
Manually.