Skip to content

Create hook for account creation that adds example screener #338

Closed

Description

@prestoncabe

Should be generic; the actual example screener will be implemented separately

For now, this should just include a blank screener for every new account called "Example"

Activity

  1. added this to the Prototype v2 milestone on Mar 4, 2026
  2. removed this from the Prototype v2 milestone on Mar 4, 2026
  3. moved this to Ready in BDTon Mar 5, 2026
  4. joshwanf commented on Mar 10, 2026

    @joshwanf
    Collaborator

    @prestoncabe @Michael-Dratch @Justin-MacIntosh

    Here is my initial commit 36926cf

    1. Create an authenticated /api/account-hooks endpoint that takes the following request type. Sending an auth bearer token should already include the account's user ID.

      type AccountHookRequest = {
        action: "add example screener" | "some other action"
      }
    2. Call the endpoint after successful account creation.

    3. The endpoint can then call addExampleScreenerToAccount() and will act like a normal API request.

    I think there are two places we can call the endpoint:

    1. In the frontend context/AuthContext.jsx and modify register(email, password) by using createUserWithEmailAndPassword(auth, email, password).then(someHookFunction).
    2. In the Firebase Auth by adding a Firebase Cloud Function. This would store the hook trigger and function in a separate file and would need Firebase to configure it.

    I'm leaning towards putting the API request in the frontend so the hook is stored in the same location as the account creation code and not tied to Firebase.

    • Advantage: Account creation hook code is next to account registration code. Deployment is not linked to Firebase Cloud Function. If we move away from Firebase Auth, we don't have to worry about porting over that piece of code
    • Disadvantage: Errors are not tied to new Firebase account registrations. If there is an error in the hook, the account is still created without the hook's results.
  5. moved this from Ready to In progress in BDTon Mar 10, 2026
  6. Michael-Dratch commented on Mar 12, 2026

    @Michael-Dratch
    Collaborator

    This is amazing work! Really appreciate the thought here. I'm not sure about the place to trigger this, specifically the Google login might not distinguish between creating an account and logging in. Also I feel like account creation side effects does feel like a very backend responsibility. But think triggering it here for now would be a good start and we could easily develop a backend function to call the endpoint triggered by firebase auth in the future after further discussion.

    I think you should definilty keep going in this direction. Also one small thing. I think it would be good to save the action types as an enum on the backend. We have other enums in the repo that can provide a good example.

  7. linked a pull request that will close this issueFeat/account creation hook #363on Mar 21, 2026
  8. moved this from In progress to Done in BDTon Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions