Skip to main content

TrpcAdapterContext

@h4ad/serverless-adapter > TrpcAdapterContext

(type) TrpcAdapterContext

This is the context merged between TrpcAdapterBaseContext and the that you provided.

This context will be merged with the context you created with createContext inside TrpcFrameworkOptions . So to make the type work, just send the properties you've added inside .

Signature:

export type TrpcAdapterContext<TContext> = TContext & TrpcAdapterBaseContext;

References: TrpcAdapterBaseContext

Example

type MyCustomContext = \{ user: \{ name: string } };
type TrpcContext = TrpcAdapterContext<MyCustomContext>; // your final context type to put inside trpc.router