♻️ Add abstractions for tracking server-side events (#1143)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
Luke Vella 2024-06-10 20:23:49 +01:00 committed by GitHub
parent 81d2f2c0bd
commit d43bc631f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 69 additions and 12 deletions

View file

@ -1,6 +1,7 @@
import { EmailClient } from "@rallly/emails";
import { inferAsyncReturnType, TRPCError } from "@trpc/server";
import { CreateNextContextOptions } from "@trpc/server/adapters/next";
import type { PostHog } from "posthog-node";
export type GetUserFn = (opts: CreateNextContextOptions) => Promise<{
id: string;
@ -12,6 +13,7 @@ export interface TRPCContextParams {
emailClient: EmailClient;
isSelfHosted: boolean;
isEmailBlocked?: (email: string) => boolean;
posthogClient?: PostHog;
/**
* Takes a relative path and returns an absolute URL to the app
* @param path