Skip to content

Context

Context<CustomContext, NetlifySDKContext>: TRPCNetlifyContext & NetlifySDKContext & CustomContext

Context is an extended version of tRPC’s built-in Context object that includes Netlify SDK-specific extensions.

You can consume this type when you initialize tRPC.

Type Parameters

Type ParameterDefault type
CustomContextRecord<string, unknown>
NetlifySDKContext extends NetlifySDKContextNetlifySDKContext

Example

import { type Context as BaseContext } from "@netlify/sdk/ui/functions/trpc";
type MyExtensionCustomContext = {
// ...
};
export type Context = Context<MyExtensionCustomContext>;
const trpc = initTRPC.context<Context>().create();