Skip to content

feat: add wizard state push#463

Open
fercgomes wants to merge 1 commit into
mainfrom
feat/wizard-state-push
Open

feat: add wizard state push#463
fercgomes wants to merge 1 commit into
mainfrom
feat/wizard-state-push

Conversation

@fercgomes
Copy link
Copy Markdown

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.

Copy link
Copy Markdown
Collaborator

@gewenyu99 gewenyu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some shape smells I wanted to point out.

Btw, this goes in after you in-app stack, correct? I can facilitate a release :D

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait these look the same. Do we need this helper?

Comment thread bin.ts
return {
host: creds.host,
projectId: creds.projectId,
auth: { kind: 'oauth_session', token: creds.accessToken },
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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 this pull request may close these issues.

2 participants