santiS
tRPC3y ago
1 reply
santi

How can I access ctx from inside of a procedure?

const appRouter = t.router({
  helloTab: t.procedure.input(z.object({ url: z.string().url() })).mutation(async ({ input, ctx }) => {
    //@ts-ignore
    const tab = ctx.sender.tab
    console.log(tab)
  }),
});

is something like this possible? Not working for me
Was this page helpful?