[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-trpc-middlewares":3,"mdc--h47a5v-key":37,"related-repo-trpc-middlewares":4393,"related-org-trpc-middlewares":4496},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":20,"repoUrl":21,"updatedAt":22,"license":23,"forks":24,"topics":25,"repo":32,"sourceUrl":35,"mdContent":36},"middlewares","compose middleware for tRPC procedures","Create and compose tRPC middleware with t.procedure.use(), extend context via opts.next({ ctx }), build reusable middleware with .concat() and .unstable_pipe(), define base procedures like publicProcedure and authedProcedure. Access raw input with getRawInput(). Logging, timing, OTEL tracing patterns.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"trpc","tRPC","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftrpc.png",[12,16,17],{"name":13,"slug":14,"type":15},"Backend","backend","tag",{"name":9,"slug":8,"type":15},{"name":18,"slug":19,"type":15},"Middleware","middleware",40424,"https:\u002F\u002Fgithub.com\u002Ftrpc\u002Ftrpc","2026-07-18T05:46:49.132255",null,1636,[26,27,28,29,30,31],"api","next","nextjs","prisma","react","typescript",{"repoUrl":21,"stars":20,"forks":24,"topics":33,"description":34},[26,27,28,29,30,31],"🧙‍♀️  Move Fast and Break Nothing. End-to-end typesafe APIs made easy. ","https:\u002F\u002Fgithub.com\u002Ftrpc\u002Ftrpc\u002Ftree\u002FHEAD\u002Fpackages\u002Fserver\u002Fskills\u002Fmiddlewares","---\nname: middlewares\ndescription: >\n  Create and compose tRPC middleware with t.procedure.use(), extend context via\n  opts.next({ ctx }), build reusable middleware with .concat() and .unstable_pipe(),\n  define base procedures like publicProcedure and authedProcedure. Access raw input\n  with getRawInput(). Logging, timing, OTEL tracing patterns.\ntype: core\nlibrary: trpc\nlibrary_version: '11.16.0'\nrequires:\n  - server-setup\nsources:\n  - 'trpc\u002Ftrpc:www\u002Fdocs\u002Fserver\u002Fmiddlewares.md'\n  - 'trpc\u002Ftrpc:www\u002Fdocs\u002Fserver\u002Fauthorization.md'\n  - 'trpc\u002Ftrpc:packages\u002Fserver\u002Fsrc\u002Funstable-core-do-not-import\u002Fmiddleware.ts'\n  - 'trpc\u002Ftrpc:packages\u002Fserver\u002Fsrc\u002Funstable-core-do-not-import\u002FprocedureBuilder.ts'\n---\n\n# tRPC -- Middlewares\n\n## Setup\n\n```ts\n\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC, TRPCError } from '@trpc\u002Fserver';\n\ntype Context = {\n  user?: { id: string; isAdmin: boolean };\n};\n\nconst t = initTRPC.context\u003CContext>().create();\n\nexport const router = t.router;\nexport const publicProcedure = t.procedure;\nexport const middleware = t.middleware;\n```\n\n## Core Patterns\n\n### Auth middleware that narrows context type\n\n```ts\n\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC, TRPCError } from '@trpc\u002Fserver';\n\ntype Context = {\n  user?: { id: string; isAdmin: boolean };\n};\n\nconst t = initTRPC.context\u003CContext>().create();\n\nexport const publicProcedure = t.procedure;\n\nexport const authedProcedure = t.procedure.use(async (opts) => {\n  const { ctx } = opts;\n  if (!ctx.user) {\n    throw new TRPCError({ code: 'UNAUTHORIZED' });\n  }\n  return opts.next({\n    ctx: {\n      user: ctx.user,\n    },\n  });\n});\n\nexport const adminProcedure = t.procedure.use(async (opts) => {\n  const { ctx } = opts;\n  if (!ctx.user?.isAdmin) {\n    throw new TRPCError({ code: 'UNAUTHORIZED' });\n  }\n  return opts.next({\n    ctx: {\n      user: ctx.user,\n    },\n  });\n});\n```\n\nAfter the middleware, `ctx.user` is non-nullable in downstream procedures.\n\n### Logging and timing middleware\n\n```ts\n\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nexport const loggedProcedure = t.procedure.use(async (opts) => {\n  const start = Date.now();\n\n  const result = await opts.next();\n\n  const durationMs = Date.now() - start;\n  const meta = { path: opts.path, type: opts.type, durationMs };\n\n  result.ok\n    ? console.log('OK request timing:', meta)\n    : console.error('Non-OK request timing', meta);\n\n  return result;\n});\n```\n\n### Reusable middleware with .concat()\n\n```ts\n\u002F\u002F myPlugin.ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nexport function createMyPlugin() {\n  const t = initTRPC.context\u003C{}>().meta\u003C{}>().create();\n\n  return {\n    pluginProc: t.procedure.use((opts) => {\n      return opts.next({\n        ctx: {\n          fromPlugin: 'hello from myPlugin' as const,\n        },\n      });\n    }),\n  };\n}\n```\n\n```ts\n\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC } from '@trpc\u002Fserver';\nimport { createMyPlugin } from '.\u002FmyPlugin';\n\nconst t = initTRPC.context\u003C{}>().create();\nconst plugin = createMyPlugin();\n\nexport const publicProcedure = t.procedure;\n\nexport const procedureWithPlugin = publicProcedure.concat(plugin.pluginProc);\n```\n\n`.concat()` merges a partial procedure (from any tRPC instance) into your procedure chain, as long as context and meta types overlap.\n\n### Extending middlewares with .unstable_pipe()\n\n```ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst fooMiddleware = t.middleware((opts) => {\n  return opts.next({\n    ctx: { foo: 'foo' as const },\n  });\n});\n\nconst barMiddleware = fooMiddleware.unstable_pipe((opts) => {\n  console.log(opts.ctx.foo);\n  return opts.next({\n    ctx: { bar: 'bar' as const },\n  });\n});\n\nconst barProcedure = t.procedure.use(barMiddleware);\n```\n\nPiped middlewares run in order and each receives the context from the previous middleware.\n\n## Common Mistakes\n\n### [CRITICAL] Forgetting to call and return opts.next()\n\nWrong:\n\n```ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst logMiddleware = t.middleware(async (opts) => {\n  console.log('request started');\n  \u002F\u002F forgot to call opts.next()\n});\n```\n\nCorrect:\n\n```ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst logMiddleware = t.middleware(async (opts) => {\n  console.log('request started');\n  const result = await opts.next();\n  console.log('request ended');\n  return result;\n});\n```\n\nMiddleware must call `opts.next()` and return its result; forgetting this silently drops the request with an INTERNAL_SERVER_ERROR because no middleware marker is returned.\n\nSource: packages\u002Fserver\u002Fsrc\u002Funstable-core-do-not-import\u002FprocedureBuilder.ts\n\n### [HIGH] Extending context with wrong type in opts.next()\n\nWrong:\n\n```ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst middleware = t.middleware(async (opts) => {\n  return opts.next({ ctx: 'not-an-object' });\n});\n```\n\nCorrect:\n\n```ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nasync function getUser() {\n  return { id: '1', name: 'Katt' };\n}\n\nconst middleware = t.middleware(async (opts) => {\n  return opts.next({ ctx: { user: await getUser() } });\n});\n```\n\nContext extension in `opts.next({ ctx })` must be an object; passing non-object values or overwriting required keys breaks downstream procedures.\n\nSource: www\u002Fdocs\u002Fserver\u002Fmiddlewares.md\n\n## See Also\n\n- `server-setup` -- initTRPC, routers, procedures, context\n- `validators` -- input\u002Foutput validation with Zod\n- `error-handling` -- TRPCError codes used in auth middleware\n- `auth` -- full auth patterns combining middleware + client headers\n",{"data":38,"body":48},{"name":4,"description":6,"type":39,"library":8,"library_version":40,"requires":41,"sources":43},"core","11.16.0",[42],"server-setup",[44,45,46,47],"trpc\u002Ftrpc:www\u002Fdocs\u002Fserver\u002Fmiddlewares.md","trpc\u002Ftrpc:www\u002Fdocs\u002Fserver\u002Fauthorization.md","trpc\u002Ftrpc:packages\u002Fserver\u002Fsrc\u002Funstable-core-do-not-import\u002Fmiddleware.ts","trpc\u002Ftrpc:packages\u002Fserver\u002Fsrc\u002Funstable-core-do-not-import\u002FprocedureBuilder.ts",{"type":49,"children":50},"root",[51,60,67,460,466,473,1402,1416,1422,1977,1983,2350,2630,2641,2647,3168,3173,3179,3190,3195,3409,3414,3712,3725,3730,3741,3745,3970,3974,4315,4328,4333,4339,4387],{"type":52,"tag":53,"props":54,"children":56},"element","h1",{"id":55},"trpc-middlewares",[57],{"type":58,"value":59},"text","tRPC -- Middlewares",{"type":52,"tag":61,"props":62,"children":64},"h2",{"id":63},"setup",[65],{"type":58,"value":66},"Setup",{"type":52,"tag":68,"props":69,"children":74},"pre",{"className":70,"code":71,"language":72,"meta":73,"style":73},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC, TRPCError } from '@trpc\u002Fserver';\n\ntype Context = {\n  user?: { id: string; isAdmin: boolean };\n};\n\nconst t = initTRPC.context\u003CContext>().create();\n\nexport const router = t.router;\nexport const publicProcedure = t.procedure;\nexport const middleware = t.middleware;\n","ts","",[75],{"type":52,"tag":76,"props":77,"children":78},"code",{"__ignoreMap":73},[79,91,154,164,190,248,257,265,336,344,385,423],{"type":52,"tag":80,"props":81,"children":84},"span",{"class":82,"line":83},"line",1,[85],{"type":52,"tag":80,"props":86,"children":88},{"style":87},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[89],{"type":58,"value":90},"\u002F\u002F server\u002Ftrpc.ts\n",{"type":52,"tag":80,"props":92,"children":94},{"class":82,"line":93},2,[95,101,107,113,118,123,128,133,138,144,149],{"type":52,"tag":80,"props":96,"children":98},{"style":97},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[99],{"type":58,"value":100},"import",{"type":52,"tag":80,"props":102,"children":104},{"style":103},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[105],{"type":58,"value":106}," {",{"type":52,"tag":80,"props":108,"children":110},{"style":109},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[111],{"type":58,"value":112}," initTRPC",{"type":52,"tag":80,"props":114,"children":115},{"style":103},[116],{"type":58,"value":117},",",{"type":52,"tag":80,"props":119,"children":120},{"style":109},[121],{"type":58,"value":122}," TRPCError",{"type":52,"tag":80,"props":124,"children":125},{"style":103},[126],{"type":58,"value":127}," }",{"type":52,"tag":80,"props":129,"children":130},{"style":97},[131],{"type":58,"value":132}," from",{"type":52,"tag":80,"props":134,"children":135},{"style":103},[136],{"type":58,"value":137}," '",{"type":52,"tag":80,"props":139,"children":141},{"style":140},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[142],{"type":58,"value":143},"@trpc\u002Fserver",{"type":52,"tag":80,"props":145,"children":146},{"style":103},[147],{"type":58,"value":148},"'",{"type":52,"tag":80,"props":150,"children":151},{"style":103},[152],{"type":58,"value":153},";\n",{"type":52,"tag":80,"props":155,"children":157},{"class":82,"line":156},3,[158],{"type":52,"tag":80,"props":159,"children":161},{"emptyLinePlaceholder":160},true,[162],{"type":58,"value":163},"\n",{"type":52,"tag":80,"props":165,"children":167},{"class":82,"line":166},4,[168,174,180,185],{"type":52,"tag":80,"props":169,"children":171},{"style":170},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[172],{"type":58,"value":173},"type",{"type":52,"tag":80,"props":175,"children":177},{"style":176},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[178],{"type":58,"value":179}," Context",{"type":52,"tag":80,"props":181,"children":182},{"style":103},[183],{"type":58,"value":184}," =",{"type":52,"tag":80,"props":186,"children":187},{"style":103},[188],{"type":58,"value":189}," {\n",{"type":52,"tag":80,"props":191,"children":193},{"class":82,"line":192},5,[194,200,205,209,214,219,224,229,234,238,243],{"type":52,"tag":80,"props":195,"children":197},{"style":196},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[198],{"type":58,"value":199},"  user",{"type":52,"tag":80,"props":201,"children":202},{"style":103},[203],{"type":58,"value":204},"?:",{"type":52,"tag":80,"props":206,"children":207},{"style":103},[208],{"type":58,"value":106},{"type":52,"tag":80,"props":210,"children":211},{"style":196},[212],{"type":58,"value":213}," id",{"type":52,"tag":80,"props":215,"children":216},{"style":103},[217],{"type":58,"value":218},":",{"type":52,"tag":80,"props":220,"children":221},{"style":176},[222],{"type":58,"value":223}," string",{"type":52,"tag":80,"props":225,"children":226},{"style":103},[227],{"type":58,"value":228},";",{"type":52,"tag":80,"props":230,"children":231},{"style":196},[232],{"type":58,"value":233}," isAdmin",{"type":52,"tag":80,"props":235,"children":236},{"style":103},[237],{"type":58,"value":218},{"type":52,"tag":80,"props":239,"children":240},{"style":176},[241],{"type":58,"value":242}," boolean",{"type":52,"tag":80,"props":244,"children":245},{"style":103},[246],{"type":58,"value":247}," };\n",{"type":52,"tag":80,"props":249,"children":251},{"class":82,"line":250},6,[252],{"type":52,"tag":80,"props":253,"children":254},{"style":103},[255],{"type":58,"value":256},"};\n",{"type":52,"tag":80,"props":258,"children":260},{"class":82,"line":259},7,[261],{"type":52,"tag":80,"props":262,"children":263},{"emptyLinePlaceholder":160},[264],{"type":58,"value":163},{"type":52,"tag":80,"props":266,"children":268},{"class":82,"line":267},8,[269,274,279,284,288,293,299,304,309,314,319,323,328,332],{"type":52,"tag":80,"props":270,"children":271},{"style":170},[272],{"type":58,"value":273},"const",{"type":52,"tag":80,"props":275,"children":276},{"style":109},[277],{"type":58,"value":278}," t ",{"type":52,"tag":80,"props":280,"children":281},{"style":103},[282],{"type":58,"value":283},"=",{"type":52,"tag":80,"props":285,"children":286},{"style":109},[287],{"type":58,"value":112},{"type":52,"tag":80,"props":289,"children":290},{"style":103},[291],{"type":58,"value":292},".",{"type":52,"tag":80,"props":294,"children":296},{"style":295},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[297],{"type":58,"value":298},"context",{"type":52,"tag":80,"props":300,"children":301},{"style":103},[302],{"type":58,"value":303},"\u003C",{"type":52,"tag":80,"props":305,"children":306},{"style":176},[307],{"type":58,"value":308},"Context",{"type":52,"tag":80,"props":310,"children":311},{"style":103},[312],{"type":58,"value":313},">",{"type":52,"tag":80,"props":315,"children":316},{"style":109},[317],{"type":58,"value":318},"()",{"type":52,"tag":80,"props":320,"children":321},{"style":103},[322],{"type":58,"value":292},{"type":52,"tag":80,"props":324,"children":325},{"style":295},[326],{"type":58,"value":327},"create",{"type":52,"tag":80,"props":329,"children":330},{"style":109},[331],{"type":58,"value":318},{"type":52,"tag":80,"props":333,"children":334},{"style":103},[335],{"type":58,"value":153},{"type":52,"tag":80,"props":337,"children":339},{"class":82,"line":338},9,[340],{"type":52,"tag":80,"props":341,"children":342},{"emptyLinePlaceholder":160},[343],{"type":58,"value":163},{"type":52,"tag":80,"props":345,"children":347},{"class":82,"line":346},10,[348,353,358,363,367,372,376,381],{"type":52,"tag":80,"props":349,"children":350},{"style":97},[351],{"type":58,"value":352},"export",{"type":52,"tag":80,"props":354,"children":355},{"style":170},[356],{"type":58,"value":357}," const",{"type":52,"tag":80,"props":359,"children":360},{"style":109},[361],{"type":58,"value":362}," router ",{"type":52,"tag":80,"props":364,"children":365},{"style":103},[366],{"type":58,"value":283},{"type":52,"tag":80,"props":368,"children":369},{"style":109},[370],{"type":58,"value":371}," t",{"type":52,"tag":80,"props":373,"children":374},{"style":103},[375],{"type":58,"value":292},{"type":52,"tag":80,"props":377,"children":378},{"style":109},[379],{"type":58,"value":380},"router",{"type":52,"tag":80,"props":382,"children":383},{"style":103},[384],{"type":58,"value":153},{"type":52,"tag":80,"props":386,"children":388},{"class":82,"line":387},11,[389,393,397,402,406,410,414,419],{"type":52,"tag":80,"props":390,"children":391},{"style":97},[392],{"type":58,"value":352},{"type":52,"tag":80,"props":394,"children":395},{"style":170},[396],{"type":58,"value":357},{"type":52,"tag":80,"props":398,"children":399},{"style":109},[400],{"type":58,"value":401}," publicProcedure ",{"type":52,"tag":80,"props":403,"children":404},{"style":103},[405],{"type":58,"value":283},{"type":52,"tag":80,"props":407,"children":408},{"style":109},[409],{"type":58,"value":371},{"type":52,"tag":80,"props":411,"children":412},{"style":103},[413],{"type":58,"value":292},{"type":52,"tag":80,"props":415,"children":416},{"style":109},[417],{"type":58,"value":418},"procedure",{"type":52,"tag":80,"props":420,"children":421},{"style":103},[422],{"type":58,"value":153},{"type":52,"tag":80,"props":424,"children":426},{"class":82,"line":425},12,[427,431,435,440,444,448,452,456],{"type":52,"tag":80,"props":428,"children":429},{"style":97},[430],{"type":58,"value":352},{"type":52,"tag":80,"props":432,"children":433},{"style":170},[434],{"type":58,"value":357},{"type":52,"tag":80,"props":436,"children":437},{"style":109},[438],{"type":58,"value":439}," middleware ",{"type":52,"tag":80,"props":441,"children":442},{"style":103},[443],{"type":58,"value":283},{"type":52,"tag":80,"props":445,"children":446},{"style":109},[447],{"type":58,"value":371},{"type":52,"tag":80,"props":449,"children":450},{"style":103},[451],{"type":58,"value":292},{"type":52,"tag":80,"props":453,"children":454},{"style":109},[455],{"type":58,"value":19},{"type":52,"tag":80,"props":457,"children":458},{"style":103},[459],{"type":58,"value":153},{"type":52,"tag":61,"props":461,"children":463},{"id":462},"core-patterns",[464],{"type":58,"value":465},"Core Patterns",{"type":52,"tag":467,"props":468,"children":470},"h3",{"id":469},"auth-middleware-that-narrows-context-type",[471],{"type":58,"value":472},"Auth middleware that narrows context type",{"type":52,"tag":68,"props":474,"children":476},{"className":70,"code":475,"language":72,"meta":73,"style":73},"\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC, TRPCError } from '@trpc\u002Fserver';\n\ntype Context = {\n  user?: { id: string; isAdmin: boolean };\n};\n\nconst t = initTRPC.context\u003CContext>().create();\n\nexport const publicProcedure = t.procedure;\n\nexport const authedProcedure = t.procedure.use(async (opts) => {\n  const { ctx } = opts;\n  if (!ctx.user) {\n    throw new TRPCError({ code: 'UNAUTHORIZED' });\n  }\n  return opts.next({\n    ctx: {\n      user: ctx.user,\n    },\n  });\n});\n\nexport const adminProcedure = t.procedure.use(async (opts) => {\n  const { ctx } = opts;\n  if (!ctx.user?.isAdmin) {\n    throw new TRPCError({ code: 'UNAUTHORIZED' });\n  }\n  return opts.next({\n    ctx: {\n      user: ctx.user,\n    },\n  });\n});\n",[477],{"type":52,"tag":76,"props":478,"children":479},{"__ignoreMap":73},[480,487,534,541,560,607,614,621,680,687,722,729,805,840,882,943,952,981,998,1028,1037,1054,1071,1079,1148,1180,1226,1282,1290,1318,1334,1362,1370,1386],{"type":52,"tag":80,"props":481,"children":482},{"class":82,"line":83},[483],{"type":52,"tag":80,"props":484,"children":485},{"style":87},[486],{"type":58,"value":90},{"type":52,"tag":80,"props":488,"children":489},{"class":82,"line":93},[490,494,498,502,506,510,514,518,522,526,530],{"type":52,"tag":80,"props":491,"children":492},{"style":97},[493],{"type":58,"value":100},{"type":52,"tag":80,"props":495,"children":496},{"style":103},[497],{"type":58,"value":106},{"type":52,"tag":80,"props":499,"children":500},{"style":109},[501],{"type":58,"value":112},{"type":52,"tag":80,"props":503,"children":504},{"style":103},[505],{"type":58,"value":117},{"type":52,"tag":80,"props":507,"children":508},{"style":109},[509],{"type":58,"value":122},{"type":52,"tag":80,"props":511,"children":512},{"style":103},[513],{"type":58,"value":127},{"type":52,"tag":80,"props":515,"children":516},{"style":97},[517],{"type":58,"value":132},{"type":52,"tag":80,"props":519,"children":520},{"style":103},[521],{"type":58,"value":137},{"type":52,"tag":80,"props":523,"children":524},{"style":140},[525],{"type":58,"value":143},{"type":52,"tag":80,"props":527,"children":528},{"style":103},[529],{"type":58,"value":148},{"type":52,"tag":80,"props":531,"children":532},{"style":103},[533],{"type":58,"value":153},{"type":52,"tag":80,"props":535,"children":536},{"class":82,"line":156},[537],{"type":52,"tag":80,"props":538,"children":539},{"emptyLinePlaceholder":160},[540],{"type":58,"value":163},{"type":52,"tag":80,"props":542,"children":543},{"class":82,"line":166},[544,548,552,556],{"type":52,"tag":80,"props":545,"children":546},{"style":170},[547],{"type":58,"value":173},{"type":52,"tag":80,"props":549,"children":550},{"style":176},[551],{"type":58,"value":179},{"type":52,"tag":80,"props":553,"children":554},{"style":103},[555],{"type":58,"value":184},{"type":52,"tag":80,"props":557,"children":558},{"style":103},[559],{"type":58,"value":189},{"type":52,"tag":80,"props":561,"children":562},{"class":82,"line":192},[563,567,571,575,579,583,587,591,595,599,603],{"type":52,"tag":80,"props":564,"children":565},{"style":196},[566],{"type":58,"value":199},{"type":52,"tag":80,"props":568,"children":569},{"style":103},[570],{"type":58,"value":204},{"type":52,"tag":80,"props":572,"children":573},{"style":103},[574],{"type":58,"value":106},{"type":52,"tag":80,"props":576,"children":577},{"style":196},[578],{"type":58,"value":213},{"type":52,"tag":80,"props":580,"children":581},{"style":103},[582],{"type":58,"value":218},{"type":52,"tag":80,"props":584,"children":585},{"style":176},[586],{"type":58,"value":223},{"type":52,"tag":80,"props":588,"children":589},{"style":103},[590],{"type":58,"value":228},{"type":52,"tag":80,"props":592,"children":593},{"style":196},[594],{"type":58,"value":233},{"type":52,"tag":80,"props":596,"children":597},{"style":103},[598],{"type":58,"value":218},{"type":52,"tag":80,"props":600,"children":601},{"style":176},[602],{"type":58,"value":242},{"type":52,"tag":80,"props":604,"children":605},{"style":103},[606],{"type":58,"value":247},{"type":52,"tag":80,"props":608,"children":609},{"class":82,"line":250},[610],{"type":52,"tag":80,"props":611,"children":612},{"style":103},[613],{"type":58,"value":256},{"type":52,"tag":80,"props":615,"children":616},{"class":82,"line":259},[617],{"type":52,"tag":80,"props":618,"children":619},{"emptyLinePlaceholder":160},[620],{"type":58,"value":163},{"type":52,"tag":80,"props":622,"children":623},{"class":82,"line":267},[624,628,632,636,640,644,648,652,656,660,664,668,672,676],{"type":52,"tag":80,"props":625,"children":626},{"style":170},[627],{"type":58,"value":273},{"type":52,"tag":80,"props":629,"children":630},{"style":109},[631],{"type":58,"value":278},{"type":52,"tag":80,"props":633,"children":634},{"style":103},[635],{"type":58,"value":283},{"type":52,"tag":80,"props":637,"children":638},{"style":109},[639],{"type":58,"value":112},{"type":52,"tag":80,"props":641,"children":642},{"style":103},[643],{"type":58,"value":292},{"type":52,"tag":80,"props":645,"children":646},{"style":295},[647],{"type":58,"value":298},{"type":52,"tag":80,"props":649,"children":650},{"style":103},[651],{"type":58,"value":303},{"type":52,"tag":80,"props":653,"children":654},{"style":176},[655],{"type":58,"value":308},{"type":52,"tag":80,"props":657,"children":658},{"style":103},[659],{"type":58,"value":313},{"type":52,"tag":80,"props":661,"children":662},{"style":109},[663],{"type":58,"value":318},{"type":52,"tag":80,"props":665,"children":666},{"style":103},[667],{"type":58,"value":292},{"type":52,"tag":80,"props":669,"children":670},{"style":295},[671],{"type":58,"value":327},{"type":52,"tag":80,"props":673,"children":674},{"style":109},[675],{"type":58,"value":318},{"type":52,"tag":80,"props":677,"children":678},{"style":103},[679],{"type":58,"value":153},{"type":52,"tag":80,"props":681,"children":682},{"class":82,"line":338},[683],{"type":52,"tag":80,"props":684,"children":685},{"emptyLinePlaceholder":160},[686],{"type":58,"value":163},{"type":52,"tag":80,"props":688,"children":689},{"class":82,"line":346},[690,694,698,702,706,710,714,718],{"type":52,"tag":80,"props":691,"children":692},{"style":97},[693],{"type":58,"value":352},{"type":52,"tag":80,"props":695,"children":696},{"style":170},[697],{"type":58,"value":357},{"type":52,"tag":80,"props":699,"children":700},{"style":109},[701],{"type":58,"value":401},{"type":52,"tag":80,"props":703,"children":704},{"style":103},[705],{"type":58,"value":283},{"type":52,"tag":80,"props":707,"children":708},{"style":109},[709],{"type":58,"value":371},{"type":52,"tag":80,"props":711,"children":712},{"style":103},[713],{"type":58,"value":292},{"type":52,"tag":80,"props":715,"children":716},{"style":109},[717],{"type":58,"value":418},{"type":52,"tag":80,"props":719,"children":720},{"style":103},[721],{"type":58,"value":153},{"type":52,"tag":80,"props":723,"children":724},{"class":82,"line":387},[725],{"type":52,"tag":80,"props":726,"children":727},{"emptyLinePlaceholder":160},[728],{"type":58,"value":163},{"type":52,"tag":80,"props":730,"children":731},{"class":82,"line":425},[732,736,740,745,749,753,757,761,765,770,775,780,785,791,796,801],{"type":52,"tag":80,"props":733,"children":734},{"style":97},[735],{"type":58,"value":352},{"type":52,"tag":80,"props":737,"children":738},{"style":170},[739],{"type":58,"value":357},{"type":52,"tag":80,"props":741,"children":742},{"style":109},[743],{"type":58,"value":744}," authedProcedure ",{"type":52,"tag":80,"props":746,"children":747},{"style":103},[748],{"type":58,"value":283},{"type":52,"tag":80,"props":750,"children":751},{"style":109},[752],{"type":58,"value":371},{"type":52,"tag":80,"props":754,"children":755},{"style":103},[756],{"type":58,"value":292},{"type":52,"tag":80,"props":758,"children":759},{"style":109},[760],{"type":58,"value":418},{"type":52,"tag":80,"props":762,"children":763},{"style":103},[764],{"type":58,"value":292},{"type":52,"tag":80,"props":766,"children":767},{"style":295},[768],{"type":58,"value":769},"use",{"type":52,"tag":80,"props":771,"children":772},{"style":109},[773],{"type":58,"value":774},"(",{"type":52,"tag":80,"props":776,"children":777},{"style":170},[778],{"type":58,"value":779},"async",{"type":52,"tag":80,"props":781,"children":782},{"style":103},[783],{"type":58,"value":784}," (",{"type":52,"tag":80,"props":786,"children":788},{"style":787},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[789],{"type":58,"value":790},"opts",{"type":52,"tag":80,"props":792,"children":793},{"style":103},[794],{"type":58,"value":795},")",{"type":52,"tag":80,"props":797,"children":798},{"style":170},[799],{"type":58,"value":800}," =>",{"type":52,"tag":80,"props":802,"children":803},{"style":103},[804],{"type":58,"value":189},{"type":52,"tag":80,"props":806,"children":808},{"class":82,"line":807},13,[809,814,818,823,827,831,836],{"type":52,"tag":80,"props":810,"children":811},{"style":170},[812],{"type":58,"value":813},"  const",{"type":52,"tag":80,"props":815,"children":816},{"style":103},[817],{"type":58,"value":106},{"type":52,"tag":80,"props":819,"children":820},{"style":109},[821],{"type":58,"value":822}," ctx",{"type":52,"tag":80,"props":824,"children":825},{"style":103},[826],{"type":58,"value":127},{"type":52,"tag":80,"props":828,"children":829},{"style":103},[830],{"type":58,"value":184},{"type":52,"tag":80,"props":832,"children":833},{"style":109},[834],{"type":58,"value":835}," opts",{"type":52,"tag":80,"props":837,"children":838},{"style":103},[839],{"type":58,"value":153},{"type":52,"tag":80,"props":841,"children":843},{"class":82,"line":842},14,[844,849,853,858,863,867,872,877],{"type":52,"tag":80,"props":845,"children":846},{"style":97},[847],{"type":58,"value":848},"  if",{"type":52,"tag":80,"props":850,"children":851},{"style":196},[852],{"type":58,"value":784},{"type":52,"tag":80,"props":854,"children":855},{"style":103},[856],{"type":58,"value":857},"!",{"type":52,"tag":80,"props":859,"children":860},{"style":109},[861],{"type":58,"value":862},"ctx",{"type":52,"tag":80,"props":864,"children":865},{"style":103},[866],{"type":58,"value":292},{"type":52,"tag":80,"props":868,"children":869},{"style":109},[870],{"type":58,"value":871},"user",{"type":52,"tag":80,"props":873,"children":874},{"style":196},[875],{"type":58,"value":876},") ",{"type":52,"tag":80,"props":878,"children":879},{"style":103},[880],{"type":58,"value":881},"{\n",{"type":52,"tag":80,"props":883,"children":885},{"class":82,"line":884},15,[886,891,896,900,904,909,914,918,922,927,931,935,939],{"type":52,"tag":80,"props":887,"children":888},{"style":97},[889],{"type":58,"value":890},"    throw",{"type":52,"tag":80,"props":892,"children":893},{"style":103},[894],{"type":58,"value":895}," new",{"type":52,"tag":80,"props":897,"children":898},{"style":295},[899],{"type":58,"value":122},{"type":52,"tag":80,"props":901,"children":902},{"style":196},[903],{"type":58,"value":774},{"type":52,"tag":80,"props":905,"children":906},{"style":103},[907],{"type":58,"value":908},"{",{"type":52,"tag":80,"props":910,"children":911},{"style":196},[912],{"type":58,"value":913}," code",{"type":52,"tag":80,"props":915,"children":916},{"style":103},[917],{"type":58,"value":218},{"type":52,"tag":80,"props":919,"children":920},{"style":103},[921],{"type":58,"value":137},{"type":52,"tag":80,"props":923,"children":924},{"style":140},[925],{"type":58,"value":926},"UNAUTHORIZED",{"type":52,"tag":80,"props":928,"children":929},{"style":103},[930],{"type":58,"value":148},{"type":52,"tag":80,"props":932,"children":933},{"style":103},[934],{"type":58,"value":127},{"type":52,"tag":80,"props":936,"children":937},{"style":196},[938],{"type":58,"value":795},{"type":52,"tag":80,"props":940,"children":941},{"style":103},[942],{"type":58,"value":153},{"type":52,"tag":80,"props":944,"children":946},{"class":82,"line":945},16,[947],{"type":52,"tag":80,"props":948,"children":949},{"style":103},[950],{"type":58,"value":951},"  }\n",{"type":52,"tag":80,"props":953,"children":955},{"class":82,"line":954},17,[956,961,965,969,973,977],{"type":52,"tag":80,"props":957,"children":958},{"style":97},[959],{"type":58,"value":960},"  return",{"type":52,"tag":80,"props":962,"children":963},{"style":109},[964],{"type":58,"value":835},{"type":52,"tag":80,"props":966,"children":967},{"style":103},[968],{"type":58,"value":292},{"type":52,"tag":80,"props":970,"children":971},{"style":295},[972],{"type":58,"value":27},{"type":52,"tag":80,"props":974,"children":975},{"style":196},[976],{"type":58,"value":774},{"type":52,"tag":80,"props":978,"children":979},{"style":103},[980],{"type":58,"value":881},{"type":52,"tag":80,"props":982,"children":984},{"class":82,"line":983},18,[985,990,994],{"type":52,"tag":80,"props":986,"children":987},{"style":196},[988],{"type":58,"value":989},"    ctx",{"type":52,"tag":80,"props":991,"children":992},{"style":103},[993],{"type":58,"value":218},{"type":52,"tag":80,"props":995,"children":996},{"style":103},[997],{"type":58,"value":189},{"type":52,"tag":80,"props":999,"children":1001},{"class":82,"line":1000},19,[1002,1007,1011,1015,1019,1023],{"type":52,"tag":80,"props":1003,"children":1004},{"style":196},[1005],{"type":58,"value":1006},"      user",{"type":52,"tag":80,"props":1008,"children":1009},{"style":103},[1010],{"type":58,"value":218},{"type":52,"tag":80,"props":1012,"children":1013},{"style":109},[1014],{"type":58,"value":822},{"type":52,"tag":80,"props":1016,"children":1017},{"style":103},[1018],{"type":58,"value":292},{"type":52,"tag":80,"props":1020,"children":1021},{"style":109},[1022],{"type":58,"value":871},{"type":52,"tag":80,"props":1024,"children":1025},{"style":103},[1026],{"type":58,"value":1027},",\n",{"type":52,"tag":80,"props":1029,"children":1031},{"class":82,"line":1030},20,[1032],{"type":52,"tag":80,"props":1033,"children":1034},{"style":103},[1035],{"type":58,"value":1036},"    },\n",{"type":52,"tag":80,"props":1038,"children":1040},{"class":82,"line":1039},21,[1041,1046,1050],{"type":52,"tag":80,"props":1042,"children":1043},{"style":103},[1044],{"type":58,"value":1045},"  }",{"type":52,"tag":80,"props":1047,"children":1048},{"style":196},[1049],{"type":58,"value":795},{"type":52,"tag":80,"props":1051,"children":1052},{"style":103},[1053],{"type":58,"value":153},{"type":52,"tag":80,"props":1055,"children":1057},{"class":82,"line":1056},22,[1058,1063,1067],{"type":52,"tag":80,"props":1059,"children":1060},{"style":103},[1061],{"type":58,"value":1062},"}",{"type":52,"tag":80,"props":1064,"children":1065},{"style":109},[1066],{"type":58,"value":795},{"type":52,"tag":80,"props":1068,"children":1069},{"style":103},[1070],{"type":58,"value":153},{"type":52,"tag":80,"props":1072,"children":1074},{"class":82,"line":1073},23,[1075],{"type":52,"tag":80,"props":1076,"children":1077},{"emptyLinePlaceholder":160},[1078],{"type":58,"value":163},{"type":52,"tag":80,"props":1080,"children":1082},{"class":82,"line":1081},24,[1083,1087,1091,1096,1100,1104,1108,1112,1116,1120,1124,1128,1132,1136,1140,1144],{"type":52,"tag":80,"props":1084,"children":1085},{"style":97},[1086],{"type":58,"value":352},{"type":52,"tag":80,"props":1088,"children":1089},{"style":170},[1090],{"type":58,"value":357},{"type":52,"tag":80,"props":1092,"children":1093},{"style":109},[1094],{"type":58,"value":1095}," adminProcedure ",{"type":52,"tag":80,"props":1097,"children":1098},{"style":103},[1099],{"type":58,"value":283},{"type":52,"tag":80,"props":1101,"children":1102},{"style":109},[1103],{"type":58,"value":371},{"type":52,"tag":80,"props":1105,"children":1106},{"style":103},[1107],{"type":58,"value":292},{"type":52,"tag":80,"props":1109,"children":1110},{"style":109},[1111],{"type":58,"value":418},{"type":52,"tag":80,"props":1113,"children":1114},{"style":103},[1115],{"type":58,"value":292},{"type":52,"tag":80,"props":1117,"children":1118},{"style":295},[1119],{"type":58,"value":769},{"type":52,"tag":80,"props":1121,"children":1122},{"style":109},[1123],{"type":58,"value":774},{"type":52,"tag":80,"props":1125,"children":1126},{"style":170},[1127],{"type":58,"value":779},{"type":52,"tag":80,"props":1129,"children":1130},{"style":103},[1131],{"type":58,"value":784},{"type":52,"tag":80,"props":1133,"children":1134},{"style":787},[1135],{"type":58,"value":790},{"type":52,"tag":80,"props":1137,"children":1138},{"style":103},[1139],{"type":58,"value":795},{"type":52,"tag":80,"props":1141,"children":1142},{"style":170},[1143],{"type":58,"value":800},{"type":52,"tag":80,"props":1145,"children":1146},{"style":103},[1147],{"type":58,"value":189},{"type":52,"tag":80,"props":1149,"children":1151},{"class":82,"line":1150},25,[1152,1156,1160,1164,1168,1172,1176],{"type":52,"tag":80,"props":1153,"children":1154},{"style":170},[1155],{"type":58,"value":813},{"type":52,"tag":80,"props":1157,"children":1158},{"style":103},[1159],{"type":58,"value":106},{"type":52,"tag":80,"props":1161,"children":1162},{"style":109},[1163],{"type":58,"value":822},{"type":52,"tag":80,"props":1165,"children":1166},{"style":103},[1167],{"type":58,"value":127},{"type":52,"tag":80,"props":1169,"children":1170},{"style":103},[1171],{"type":58,"value":184},{"type":52,"tag":80,"props":1173,"children":1174},{"style":109},[1175],{"type":58,"value":835},{"type":52,"tag":80,"props":1177,"children":1178},{"style":103},[1179],{"type":58,"value":153},{"type":52,"tag":80,"props":1181,"children":1183},{"class":82,"line":1182},26,[1184,1188,1192,1196,1200,1204,1208,1213,1218,1222],{"type":52,"tag":80,"props":1185,"children":1186},{"style":97},[1187],{"type":58,"value":848},{"type":52,"tag":80,"props":1189,"children":1190},{"style":196},[1191],{"type":58,"value":784},{"type":52,"tag":80,"props":1193,"children":1194},{"style":103},[1195],{"type":58,"value":857},{"type":52,"tag":80,"props":1197,"children":1198},{"style":109},[1199],{"type":58,"value":862},{"type":52,"tag":80,"props":1201,"children":1202},{"style":103},[1203],{"type":58,"value":292},{"type":52,"tag":80,"props":1205,"children":1206},{"style":109},[1207],{"type":58,"value":871},{"type":52,"tag":80,"props":1209,"children":1210},{"style":103},[1211],{"type":58,"value":1212},"?.",{"type":52,"tag":80,"props":1214,"children":1215},{"style":109},[1216],{"type":58,"value":1217},"isAdmin",{"type":52,"tag":80,"props":1219,"children":1220},{"style":196},[1221],{"type":58,"value":876},{"type":52,"tag":80,"props":1223,"children":1224},{"style":103},[1225],{"type":58,"value":881},{"type":52,"tag":80,"props":1227,"children":1229},{"class":82,"line":1228},27,[1230,1234,1238,1242,1246,1250,1254,1258,1262,1266,1270,1274,1278],{"type":52,"tag":80,"props":1231,"children":1232},{"style":97},[1233],{"type":58,"value":890},{"type":52,"tag":80,"props":1235,"children":1236},{"style":103},[1237],{"type":58,"value":895},{"type":52,"tag":80,"props":1239,"children":1240},{"style":295},[1241],{"type":58,"value":122},{"type":52,"tag":80,"props":1243,"children":1244},{"style":196},[1245],{"type":58,"value":774},{"type":52,"tag":80,"props":1247,"children":1248},{"style":103},[1249],{"type":58,"value":908},{"type":52,"tag":80,"props":1251,"children":1252},{"style":196},[1253],{"type":58,"value":913},{"type":52,"tag":80,"props":1255,"children":1256},{"style":103},[1257],{"type":58,"value":218},{"type":52,"tag":80,"props":1259,"children":1260},{"style":103},[1261],{"type":58,"value":137},{"type":52,"tag":80,"props":1263,"children":1264},{"style":140},[1265],{"type":58,"value":926},{"type":52,"tag":80,"props":1267,"children":1268},{"style":103},[1269],{"type":58,"value":148},{"type":52,"tag":80,"props":1271,"children":1272},{"style":103},[1273],{"type":58,"value":127},{"type":52,"tag":80,"props":1275,"children":1276},{"style":196},[1277],{"type":58,"value":795},{"type":52,"tag":80,"props":1279,"children":1280},{"style":103},[1281],{"type":58,"value":153},{"type":52,"tag":80,"props":1283,"children":1285},{"class":82,"line":1284},28,[1286],{"type":52,"tag":80,"props":1287,"children":1288},{"style":103},[1289],{"type":58,"value":951},{"type":52,"tag":80,"props":1291,"children":1293},{"class":82,"line":1292},29,[1294,1298,1302,1306,1310,1314],{"type":52,"tag":80,"props":1295,"children":1296},{"style":97},[1297],{"type":58,"value":960},{"type":52,"tag":80,"props":1299,"children":1300},{"style":109},[1301],{"type":58,"value":835},{"type":52,"tag":80,"props":1303,"children":1304},{"style":103},[1305],{"type":58,"value":292},{"type":52,"tag":80,"props":1307,"children":1308},{"style":295},[1309],{"type":58,"value":27},{"type":52,"tag":80,"props":1311,"children":1312},{"style":196},[1313],{"type":58,"value":774},{"type":52,"tag":80,"props":1315,"children":1316},{"style":103},[1317],{"type":58,"value":881},{"type":52,"tag":80,"props":1319,"children":1321},{"class":82,"line":1320},30,[1322,1326,1330],{"type":52,"tag":80,"props":1323,"children":1324},{"style":196},[1325],{"type":58,"value":989},{"type":52,"tag":80,"props":1327,"children":1328},{"style":103},[1329],{"type":58,"value":218},{"type":52,"tag":80,"props":1331,"children":1332},{"style":103},[1333],{"type":58,"value":189},{"type":52,"tag":80,"props":1335,"children":1337},{"class":82,"line":1336},31,[1338,1342,1346,1350,1354,1358],{"type":52,"tag":80,"props":1339,"children":1340},{"style":196},[1341],{"type":58,"value":1006},{"type":52,"tag":80,"props":1343,"children":1344},{"style":103},[1345],{"type":58,"value":218},{"type":52,"tag":80,"props":1347,"children":1348},{"style":109},[1349],{"type":58,"value":822},{"type":52,"tag":80,"props":1351,"children":1352},{"style":103},[1353],{"type":58,"value":292},{"type":52,"tag":80,"props":1355,"children":1356},{"style":109},[1357],{"type":58,"value":871},{"type":52,"tag":80,"props":1359,"children":1360},{"style":103},[1361],{"type":58,"value":1027},{"type":52,"tag":80,"props":1363,"children":1365},{"class":82,"line":1364},32,[1366],{"type":52,"tag":80,"props":1367,"children":1368},{"style":103},[1369],{"type":58,"value":1036},{"type":52,"tag":80,"props":1371,"children":1373},{"class":82,"line":1372},33,[1374,1378,1382],{"type":52,"tag":80,"props":1375,"children":1376},{"style":103},[1377],{"type":58,"value":1045},{"type":52,"tag":80,"props":1379,"children":1380},{"style":196},[1381],{"type":58,"value":795},{"type":52,"tag":80,"props":1383,"children":1384},{"style":103},[1385],{"type":58,"value":153},{"type":52,"tag":80,"props":1387,"children":1389},{"class":82,"line":1388},34,[1390,1394,1398],{"type":52,"tag":80,"props":1391,"children":1392},{"style":103},[1393],{"type":58,"value":1062},{"type":52,"tag":80,"props":1395,"children":1396},{"style":109},[1397],{"type":58,"value":795},{"type":52,"tag":80,"props":1399,"children":1400},{"style":103},[1401],{"type":58,"value":153},{"type":52,"tag":1403,"props":1404,"children":1405},"p",{},[1406,1408,1414],{"type":58,"value":1407},"After the middleware, ",{"type":52,"tag":76,"props":1409,"children":1411},{"className":1410},[],[1412],{"type":58,"value":1413},"ctx.user",{"type":58,"value":1415}," is non-nullable in downstream procedures.",{"type":52,"tag":467,"props":1417,"children":1419},{"id":1418},"logging-and-timing-middleware",[1420],{"type":58,"value":1421},"Logging and timing middleware",{"type":52,"tag":68,"props":1423,"children":1425},{"className":70,"code":1424,"language":72,"meta":73,"style":73},"\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nexport const loggedProcedure = t.procedure.use(async (opts) => {\n  const start = Date.now();\n\n  const result = await opts.next();\n\n  const durationMs = Date.now() - start;\n  const meta = { path: opts.path, type: opts.type, durationMs };\n\n  result.ok\n    ? console.log('OK request timing:', meta)\n    : console.error('Non-OK request timing', meta);\n\n  return result;\n});\n",[1426],{"type":52,"tag":76,"props":1427,"children":1428},{"__ignoreMap":73},[1429,1436,1475,1482,1517,1524,1592,1630,1637,1678,1685,1731,1810,1817,1834,1886,1940,1947,1962],{"type":52,"tag":80,"props":1430,"children":1431},{"class":82,"line":83},[1432],{"type":52,"tag":80,"props":1433,"children":1434},{"style":87},[1435],{"type":58,"value":90},{"type":52,"tag":80,"props":1437,"children":1438},{"class":82,"line":93},[1439,1443,1447,1451,1455,1459,1463,1467,1471],{"type":52,"tag":80,"props":1440,"children":1441},{"style":97},[1442],{"type":58,"value":100},{"type":52,"tag":80,"props":1444,"children":1445},{"style":103},[1446],{"type":58,"value":106},{"type":52,"tag":80,"props":1448,"children":1449},{"style":109},[1450],{"type":58,"value":112},{"type":52,"tag":80,"props":1452,"children":1453},{"style":103},[1454],{"type":58,"value":127},{"type":52,"tag":80,"props":1456,"children":1457},{"style":97},[1458],{"type":58,"value":132},{"type":52,"tag":80,"props":1460,"children":1461},{"style":103},[1462],{"type":58,"value":137},{"type":52,"tag":80,"props":1464,"children":1465},{"style":140},[1466],{"type":58,"value":143},{"type":52,"tag":80,"props":1468,"children":1469},{"style":103},[1470],{"type":58,"value":148},{"type":52,"tag":80,"props":1472,"children":1473},{"style":103},[1474],{"type":58,"value":153},{"type":52,"tag":80,"props":1476,"children":1477},{"class":82,"line":156},[1478],{"type":52,"tag":80,"props":1479,"children":1480},{"emptyLinePlaceholder":160},[1481],{"type":58,"value":163},{"type":52,"tag":80,"props":1483,"children":1484},{"class":82,"line":166},[1485,1489,1493,1497,1501,1505,1509,1513],{"type":52,"tag":80,"props":1486,"children":1487},{"style":170},[1488],{"type":58,"value":273},{"type":52,"tag":80,"props":1490,"children":1491},{"style":109},[1492],{"type":58,"value":278},{"type":52,"tag":80,"props":1494,"children":1495},{"style":103},[1496],{"type":58,"value":283},{"type":52,"tag":80,"props":1498,"children":1499},{"style":109},[1500],{"type":58,"value":112},{"type":52,"tag":80,"props":1502,"children":1503},{"style":103},[1504],{"type":58,"value":292},{"type":52,"tag":80,"props":1506,"children":1507},{"style":295},[1508],{"type":58,"value":327},{"type":52,"tag":80,"props":1510,"children":1511},{"style":109},[1512],{"type":58,"value":318},{"type":52,"tag":80,"props":1514,"children":1515},{"style":103},[1516],{"type":58,"value":153},{"type":52,"tag":80,"props":1518,"children":1519},{"class":82,"line":192},[1520],{"type":52,"tag":80,"props":1521,"children":1522},{"emptyLinePlaceholder":160},[1523],{"type":58,"value":163},{"type":52,"tag":80,"props":1525,"children":1526},{"class":82,"line":250},[1527,1531,1535,1540,1544,1548,1552,1556,1560,1564,1568,1572,1576,1580,1584,1588],{"type":52,"tag":80,"props":1528,"children":1529},{"style":97},[1530],{"type":58,"value":352},{"type":52,"tag":80,"props":1532,"children":1533},{"style":170},[1534],{"type":58,"value":357},{"type":52,"tag":80,"props":1536,"children":1537},{"style":109},[1538],{"type":58,"value":1539}," loggedProcedure ",{"type":52,"tag":80,"props":1541,"children":1542},{"style":103},[1543],{"type":58,"value":283},{"type":52,"tag":80,"props":1545,"children":1546},{"style":109},[1547],{"type":58,"value":371},{"type":52,"tag":80,"props":1549,"children":1550},{"style":103},[1551],{"type":58,"value":292},{"type":52,"tag":80,"props":1553,"children":1554},{"style":109},[1555],{"type":58,"value":418},{"type":52,"tag":80,"props":1557,"children":1558},{"style":103},[1559],{"type":58,"value":292},{"type":52,"tag":80,"props":1561,"children":1562},{"style":295},[1563],{"type":58,"value":769},{"type":52,"tag":80,"props":1565,"children":1566},{"style":109},[1567],{"type":58,"value":774},{"type":52,"tag":80,"props":1569,"children":1570},{"style":170},[1571],{"type":58,"value":779},{"type":52,"tag":80,"props":1573,"children":1574},{"style":103},[1575],{"type":58,"value":784},{"type":52,"tag":80,"props":1577,"children":1578},{"style":787},[1579],{"type":58,"value":790},{"type":52,"tag":80,"props":1581,"children":1582},{"style":103},[1583],{"type":58,"value":795},{"type":52,"tag":80,"props":1585,"children":1586},{"style":170},[1587],{"type":58,"value":800},{"type":52,"tag":80,"props":1589,"children":1590},{"style":103},[1591],{"type":58,"value":189},{"type":52,"tag":80,"props":1593,"children":1594},{"class":82,"line":259},[1595,1599,1604,1608,1613,1617,1622,1626],{"type":52,"tag":80,"props":1596,"children":1597},{"style":170},[1598],{"type":58,"value":813},{"type":52,"tag":80,"props":1600,"children":1601},{"style":109},[1602],{"type":58,"value":1603}," start",{"type":52,"tag":80,"props":1605,"children":1606},{"style":103},[1607],{"type":58,"value":184},{"type":52,"tag":80,"props":1609,"children":1610},{"style":109},[1611],{"type":58,"value":1612}," Date",{"type":52,"tag":80,"props":1614,"children":1615},{"style":103},[1616],{"type":58,"value":292},{"type":52,"tag":80,"props":1618,"children":1619},{"style":295},[1620],{"type":58,"value":1621},"now",{"type":52,"tag":80,"props":1623,"children":1624},{"style":196},[1625],{"type":58,"value":318},{"type":52,"tag":80,"props":1627,"children":1628},{"style":103},[1629],{"type":58,"value":153},{"type":52,"tag":80,"props":1631,"children":1632},{"class":82,"line":267},[1633],{"type":52,"tag":80,"props":1634,"children":1635},{"emptyLinePlaceholder":160},[1636],{"type":58,"value":163},{"type":52,"tag":80,"props":1638,"children":1639},{"class":82,"line":338},[1640,1644,1649,1653,1658,1662,1666,1670,1674],{"type":52,"tag":80,"props":1641,"children":1642},{"style":170},[1643],{"type":58,"value":813},{"type":52,"tag":80,"props":1645,"children":1646},{"style":109},[1647],{"type":58,"value":1648}," result",{"type":52,"tag":80,"props":1650,"children":1651},{"style":103},[1652],{"type":58,"value":184},{"type":52,"tag":80,"props":1654,"children":1655},{"style":97},[1656],{"type":58,"value":1657}," await",{"type":52,"tag":80,"props":1659,"children":1660},{"style":109},[1661],{"type":58,"value":835},{"type":52,"tag":80,"props":1663,"children":1664},{"style":103},[1665],{"type":58,"value":292},{"type":52,"tag":80,"props":1667,"children":1668},{"style":295},[1669],{"type":58,"value":27},{"type":52,"tag":80,"props":1671,"children":1672},{"style":196},[1673],{"type":58,"value":318},{"type":52,"tag":80,"props":1675,"children":1676},{"style":103},[1677],{"type":58,"value":153},{"type":52,"tag":80,"props":1679,"children":1680},{"class":82,"line":346},[1681],{"type":52,"tag":80,"props":1682,"children":1683},{"emptyLinePlaceholder":160},[1684],{"type":58,"value":163},{"type":52,"tag":80,"props":1686,"children":1687},{"class":82,"line":387},[1688,1692,1697,1701,1705,1709,1713,1718,1723,1727],{"type":52,"tag":80,"props":1689,"children":1690},{"style":170},[1691],{"type":58,"value":813},{"type":52,"tag":80,"props":1693,"children":1694},{"style":109},[1695],{"type":58,"value":1696}," durationMs",{"type":52,"tag":80,"props":1698,"children":1699},{"style":103},[1700],{"type":58,"value":184},{"type":52,"tag":80,"props":1702,"children":1703},{"style":109},[1704],{"type":58,"value":1612},{"type":52,"tag":80,"props":1706,"children":1707},{"style":103},[1708],{"type":58,"value":292},{"type":52,"tag":80,"props":1710,"children":1711},{"style":295},[1712],{"type":58,"value":1621},{"type":52,"tag":80,"props":1714,"children":1715},{"style":196},[1716],{"type":58,"value":1717},"() ",{"type":52,"tag":80,"props":1719,"children":1720},{"style":103},[1721],{"type":58,"value":1722},"-",{"type":52,"tag":80,"props":1724,"children":1725},{"style":109},[1726],{"type":58,"value":1603},{"type":52,"tag":80,"props":1728,"children":1729},{"style":103},[1730],{"type":58,"value":153},{"type":52,"tag":80,"props":1732,"children":1733},{"class":82,"line":425},[1734,1738,1743,1747,1751,1756,1760,1764,1768,1773,1777,1782,1786,1790,1794,1798,1802,1806],{"type":52,"tag":80,"props":1735,"children":1736},{"style":170},[1737],{"type":58,"value":813},{"type":52,"tag":80,"props":1739,"children":1740},{"style":109},[1741],{"type":58,"value":1742}," meta",{"type":52,"tag":80,"props":1744,"children":1745},{"style":103},[1746],{"type":58,"value":184},{"type":52,"tag":80,"props":1748,"children":1749},{"style":103},[1750],{"type":58,"value":106},{"type":52,"tag":80,"props":1752,"children":1753},{"style":196},[1754],{"type":58,"value":1755}," path",{"type":52,"tag":80,"props":1757,"children":1758},{"style":103},[1759],{"type":58,"value":218},{"type":52,"tag":80,"props":1761,"children":1762},{"style":109},[1763],{"type":58,"value":835},{"type":52,"tag":80,"props":1765,"children":1766},{"style":103},[1767],{"type":58,"value":292},{"type":52,"tag":80,"props":1769,"children":1770},{"style":109},[1771],{"type":58,"value":1772},"path",{"type":52,"tag":80,"props":1774,"children":1775},{"style":103},[1776],{"type":58,"value":117},{"type":52,"tag":80,"props":1778,"children":1779},{"style":196},[1780],{"type":58,"value":1781}," type",{"type":52,"tag":80,"props":1783,"children":1784},{"style":103},[1785],{"type":58,"value":218},{"type":52,"tag":80,"props":1787,"children":1788},{"style":109},[1789],{"type":58,"value":835},{"type":52,"tag":80,"props":1791,"children":1792},{"style":103},[1793],{"type":58,"value":292},{"type":52,"tag":80,"props":1795,"children":1796},{"style":109},[1797],{"type":58,"value":173},{"type":52,"tag":80,"props":1799,"children":1800},{"style":103},[1801],{"type":58,"value":117},{"type":52,"tag":80,"props":1803,"children":1804},{"style":109},[1805],{"type":58,"value":1696},{"type":52,"tag":80,"props":1807,"children":1808},{"style":103},[1809],{"type":58,"value":247},{"type":52,"tag":80,"props":1811,"children":1812},{"class":82,"line":807},[1813],{"type":52,"tag":80,"props":1814,"children":1815},{"emptyLinePlaceholder":160},[1816],{"type":58,"value":163},{"type":52,"tag":80,"props":1818,"children":1819},{"class":82,"line":842},[1820,1825,1829],{"type":52,"tag":80,"props":1821,"children":1822},{"style":109},[1823],{"type":58,"value":1824},"  result",{"type":52,"tag":80,"props":1826,"children":1827},{"style":103},[1828],{"type":58,"value":292},{"type":52,"tag":80,"props":1830,"children":1831},{"style":109},[1832],{"type":58,"value":1833},"ok\n",{"type":52,"tag":80,"props":1835,"children":1836},{"class":82,"line":884},[1837,1842,1847,1851,1856,1860,1864,1869,1873,1877,1881],{"type":52,"tag":80,"props":1838,"children":1839},{"style":103},[1840],{"type":58,"value":1841},"    ?",{"type":52,"tag":80,"props":1843,"children":1844},{"style":109},[1845],{"type":58,"value":1846}," console",{"type":52,"tag":80,"props":1848,"children":1849},{"style":103},[1850],{"type":58,"value":292},{"type":52,"tag":80,"props":1852,"children":1853},{"style":295},[1854],{"type":58,"value":1855},"log",{"type":52,"tag":80,"props":1857,"children":1858},{"style":196},[1859],{"type":58,"value":774},{"type":52,"tag":80,"props":1861,"children":1862},{"style":103},[1863],{"type":58,"value":148},{"type":52,"tag":80,"props":1865,"children":1866},{"style":140},[1867],{"type":58,"value":1868},"OK request timing:",{"type":52,"tag":80,"props":1870,"children":1871},{"style":103},[1872],{"type":58,"value":148},{"type":52,"tag":80,"props":1874,"children":1875},{"style":103},[1876],{"type":58,"value":117},{"type":52,"tag":80,"props":1878,"children":1879},{"style":109},[1880],{"type":58,"value":1742},{"type":52,"tag":80,"props":1882,"children":1883},{"style":196},[1884],{"type":58,"value":1885},")\n",{"type":52,"tag":80,"props":1887,"children":1888},{"class":82,"line":945},[1889,1894,1898,1902,1907,1911,1915,1920,1924,1928,1932,1936],{"type":52,"tag":80,"props":1890,"children":1891},{"style":103},[1892],{"type":58,"value":1893},"    :",{"type":52,"tag":80,"props":1895,"children":1896},{"style":109},[1897],{"type":58,"value":1846},{"type":52,"tag":80,"props":1899,"children":1900},{"style":103},[1901],{"type":58,"value":292},{"type":52,"tag":80,"props":1903,"children":1904},{"style":295},[1905],{"type":58,"value":1906},"error",{"type":52,"tag":80,"props":1908,"children":1909},{"style":196},[1910],{"type":58,"value":774},{"type":52,"tag":80,"props":1912,"children":1913},{"style":103},[1914],{"type":58,"value":148},{"type":52,"tag":80,"props":1916,"children":1917},{"style":140},[1918],{"type":58,"value":1919},"Non-OK request timing",{"type":52,"tag":80,"props":1921,"children":1922},{"style":103},[1923],{"type":58,"value":148},{"type":52,"tag":80,"props":1925,"children":1926},{"style":103},[1927],{"type":58,"value":117},{"type":52,"tag":80,"props":1929,"children":1930},{"style":109},[1931],{"type":58,"value":1742},{"type":52,"tag":80,"props":1933,"children":1934},{"style":196},[1935],{"type":58,"value":795},{"type":52,"tag":80,"props":1937,"children":1938},{"style":103},[1939],{"type":58,"value":153},{"type":52,"tag":80,"props":1941,"children":1942},{"class":82,"line":954},[1943],{"type":52,"tag":80,"props":1944,"children":1945},{"emptyLinePlaceholder":160},[1946],{"type":58,"value":163},{"type":52,"tag":80,"props":1948,"children":1949},{"class":82,"line":983},[1950,1954,1958],{"type":52,"tag":80,"props":1951,"children":1952},{"style":97},[1953],{"type":58,"value":960},{"type":52,"tag":80,"props":1955,"children":1956},{"style":109},[1957],{"type":58,"value":1648},{"type":52,"tag":80,"props":1959,"children":1960},{"style":103},[1961],{"type":58,"value":153},{"type":52,"tag":80,"props":1963,"children":1964},{"class":82,"line":1000},[1965,1969,1973],{"type":52,"tag":80,"props":1966,"children":1967},{"style":103},[1968],{"type":58,"value":1062},{"type":52,"tag":80,"props":1970,"children":1971},{"style":109},[1972],{"type":58,"value":795},{"type":52,"tag":80,"props":1974,"children":1975},{"style":103},[1976],{"type":58,"value":153},{"type":52,"tag":467,"props":1978,"children":1980},{"id":1979},"reusable-middleware-with-concat",[1981],{"type":58,"value":1982},"Reusable middleware with .concat()",{"type":52,"tag":68,"props":1984,"children":1986},{"className":70,"code":1985,"language":72,"meta":73,"style":73},"\u002F\u002F myPlugin.ts\nimport { initTRPC } from '@trpc\u002Fserver';\n\nexport function createMyPlugin() {\n  const t = initTRPC.context\u003C{}>().meta\u003C{}>().create();\n\n  return {\n    pluginProc: t.procedure.use((opts) => {\n      return opts.next({\n        ctx: {\n          fromPlugin: 'hello from myPlugin' as const,\n        },\n      });\n    }),\n  };\n}\n",[1987],{"type":52,"tag":76,"props":1988,"children":1989},{"__ignoreMap":73},[1990,1998,2037,2044,2069,2138,2145,2156,2212,2240,2256,2294,2302,2318,2334,2342],{"type":52,"tag":80,"props":1991,"children":1992},{"class":82,"line":83},[1993],{"type":52,"tag":80,"props":1994,"children":1995},{"style":87},[1996],{"type":58,"value":1997},"\u002F\u002F myPlugin.ts\n",{"type":52,"tag":80,"props":1999,"children":2000},{"class":82,"line":93},[2001,2005,2009,2013,2017,2021,2025,2029,2033],{"type":52,"tag":80,"props":2002,"children":2003},{"style":97},[2004],{"type":58,"value":100},{"type":52,"tag":80,"props":2006,"children":2007},{"style":103},[2008],{"type":58,"value":106},{"type":52,"tag":80,"props":2010,"children":2011},{"style":109},[2012],{"type":58,"value":112},{"type":52,"tag":80,"props":2014,"children":2015},{"style":103},[2016],{"type":58,"value":127},{"type":52,"tag":80,"props":2018,"children":2019},{"style":97},[2020],{"type":58,"value":132},{"type":52,"tag":80,"props":2022,"children":2023},{"style":103},[2024],{"type":58,"value":137},{"type":52,"tag":80,"props":2026,"children":2027},{"style":140},[2028],{"type":58,"value":143},{"type":52,"tag":80,"props":2030,"children":2031},{"style":103},[2032],{"type":58,"value":148},{"type":52,"tag":80,"props":2034,"children":2035},{"style":103},[2036],{"type":58,"value":153},{"type":52,"tag":80,"props":2038,"children":2039},{"class":82,"line":156},[2040],{"type":52,"tag":80,"props":2041,"children":2042},{"emptyLinePlaceholder":160},[2043],{"type":58,"value":163},{"type":52,"tag":80,"props":2045,"children":2046},{"class":82,"line":166},[2047,2051,2056,2061,2065],{"type":52,"tag":80,"props":2048,"children":2049},{"style":97},[2050],{"type":58,"value":352},{"type":52,"tag":80,"props":2052,"children":2053},{"style":170},[2054],{"type":58,"value":2055}," function",{"type":52,"tag":80,"props":2057,"children":2058},{"style":295},[2059],{"type":58,"value":2060}," createMyPlugin",{"type":52,"tag":80,"props":2062,"children":2063},{"style":103},[2064],{"type":58,"value":318},{"type":52,"tag":80,"props":2066,"children":2067},{"style":103},[2068],{"type":58,"value":189},{"type":52,"tag":80,"props":2070,"children":2071},{"class":82,"line":192},[2072,2076,2080,2084,2088,2092,2096,2101,2105,2109,2114,2118,2122,2126,2130,2134],{"type":52,"tag":80,"props":2073,"children":2074},{"style":170},[2075],{"type":58,"value":813},{"type":52,"tag":80,"props":2077,"children":2078},{"style":109},[2079],{"type":58,"value":371},{"type":52,"tag":80,"props":2081,"children":2082},{"style":103},[2083],{"type":58,"value":184},{"type":52,"tag":80,"props":2085,"children":2086},{"style":109},[2087],{"type":58,"value":112},{"type":52,"tag":80,"props":2089,"children":2090},{"style":103},[2091],{"type":58,"value":292},{"type":52,"tag":80,"props":2093,"children":2094},{"style":295},[2095],{"type":58,"value":298},{"type":52,"tag":80,"props":2097,"children":2098},{"style":103},[2099],{"type":58,"value":2100},"\u003C{}>",{"type":52,"tag":80,"props":2102,"children":2103},{"style":196},[2104],{"type":58,"value":318},{"type":52,"tag":80,"props":2106,"children":2107},{"style":103},[2108],{"type":58,"value":292},{"type":52,"tag":80,"props":2110,"children":2111},{"style":295},[2112],{"type":58,"value":2113},"meta",{"type":52,"tag":80,"props":2115,"children":2116},{"style":103},[2117],{"type":58,"value":2100},{"type":52,"tag":80,"props":2119,"children":2120},{"style":196},[2121],{"type":58,"value":318},{"type":52,"tag":80,"props":2123,"children":2124},{"style":103},[2125],{"type":58,"value":292},{"type":52,"tag":80,"props":2127,"children":2128},{"style":295},[2129],{"type":58,"value":327},{"type":52,"tag":80,"props":2131,"children":2132},{"style":196},[2133],{"type":58,"value":318},{"type":52,"tag":80,"props":2135,"children":2136},{"style":103},[2137],{"type":58,"value":153},{"type":52,"tag":80,"props":2139,"children":2140},{"class":82,"line":250},[2141],{"type":52,"tag":80,"props":2142,"children":2143},{"emptyLinePlaceholder":160},[2144],{"type":58,"value":163},{"type":52,"tag":80,"props":2146,"children":2147},{"class":82,"line":259},[2148,2152],{"type":52,"tag":80,"props":2149,"children":2150},{"style":97},[2151],{"type":58,"value":960},{"type":52,"tag":80,"props":2153,"children":2154},{"style":103},[2155],{"type":58,"value":189},{"type":52,"tag":80,"props":2157,"children":2158},{"class":82,"line":267},[2159,2164,2168,2172,2176,2180,2184,2188,2192,2196,2200,2204,2208],{"type":52,"tag":80,"props":2160,"children":2161},{"style":196},[2162],{"type":58,"value":2163},"    pluginProc",{"type":52,"tag":80,"props":2165,"children":2166},{"style":103},[2167],{"type":58,"value":218},{"type":52,"tag":80,"props":2169,"children":2170},{"style":109},[2171],{"type":58,"value":371},{"type":52,"tag":80,"props":2173,"children":2174},{"style":103},[2175],{"type":58,"value":292},{"type":52,"tag":80,"props":2177,"children":2178},{"style":109},[2179],{"type":58,"value":418},{"type":52,"tag":80,"props":2181,"children":2182},{"style":103},[2183],{"type":58,"value":292},{"type":52,"tag":80,"props":2185,"children":2186},{"style":295},[2187],{"type":58,"value":769},{"type":52,"tag":80,"props":2189,"children":2190},{"style":196},[2191],{"type":58,"value":774},{"type":52,"tag":80,"props":2193,"children":2194},{"style":103},[2195],{"type":58,"value":774},{"type":52,"tag":80,"props":2197,"children":2198},{"style":787},[2199],{"type":58,"value":790},{"type":52,"tag":80,"props":2201,"children":2202},{"style":103},[2203],{"type":58,"value":795},{"type":52,"tag":80,"props":2205,"children":2206},{"style":170},[2207],{"type":58,"value":800},{"type":52,"tag":80,"props":2209,"children":2210},{"style":103},[2211],{"type":58,"value":189},{"type":52,"tag":80,"props":2213,"children":2214},{"class":82,"line":338},[2215,2220,2224,2228,2232,2236],{"type":52,"tag":80,"props":2216,"children":2217},{"style":97},[2218],{"type":58,"value":2219},"      return",{"type":52,"tag":80,"props":2221,"children":2222},{"style":109},[2223],{"type":58,"value":835},{"type":52,"tag":80,"props":2225,"children":2226},{"style":103},[2227],{"type":58,"value":292},{"type":52,"tag":80,"props":2229,"children":2230},{"style":295},[2231],{"type":58,"value":27},{"type":52,"tag":80,"props":2233,"children":2234},{"style":196},[2235],{"type":58,"value":774},{"type":52,"tag":80,"props":2237,"children":2238},{"style":103},[2239],{"type":58,"value":881},{"type":52,"tag":80,"props":2241,"children":2242},{"class":82,"line":346},[2243,2248,2252],{"type":52,"tag":80,"props":2244,"children":2245},{"style":196},[2246],{"type":58,"value":2247},"        ctx",{"type":52,"tag":80,"props":2249,"children":2250},{"style":103},[2251],{"type":58,"value":218},{"type":52,"tag":80,"props":2253,"children":2254},{"style":103},[2255],{"type":58,"value":189},{"type":52,"tag":80,"props":2257,"children":2258},{"class":82,"line":387},[2259,2264,2268,2272,2277,2281,2286,2290],{"type":52,"tag":80,"props":2260,"children":2261},{"style":196},[2262],{"type":58,"value":2263},"          fromPlugin",{"type":52,"tag":80,"props":2265,"children":2266},{"style":103},[2267],{"type":58,"value":218},{"type":52,"tag":80,"props":2269,"children":2270},{"style":103},[2271],{"type":58,"value":137},{"type":52,"tag":80,"props":2273,"children":2274},{"style":140},[2275],{"type":58,"value":2276},"hello from myPlugin",{"type":52,"tag":80,"props":2278,"children":2279},{"style":103},[2280],{"type":58,"value":148},{"type":52,"tag":80,"props":2282,"children":2283},{"style":97},[2284],{"type":58,"value":2285}," as",{"type":52,"tag":80,"props":2287,"children":2288},{"style":170},[2289],{"type":58,"value":357},{"type":52,"tag":80,"props":2291,"children":2292},{"style":103},[2293],{"type":58,"value":1027},{"type":52,"tag":80,"props":2295,"children":2296},{"class":82,"line":425},[2297],{"type":52,"tag":80,"props":2298,"children":2299},{"style":103},[2300],{"type":58,"value":2301},"        },\n",{"type":52,"tag":80,"props":2303,"children":2304},{"class":82,"line":807},[2305,2310,2314],{"type":52,"tag":80,"props":2306,"children":2307},{"style":103},[2308],{"type":58,"value":2309},"      }",{"type":52,"tag":80,"props":2311,"children":2312},{"style":196},[2313],{"type":58,"value":795},{"type":52,"tag":80,"props":2315,"children":2316},{"style":103},[2317],{"type":58,"value":153},{"type":52,"tag":80,"props":2319,"children":2320},{"class":82,"line":842},[2321,2326,2330],{"type":52,"tag":80,"props":2322,"children":2323},{"style":103},[2324],{"type":58,"value":2325},"    }",{"type":52,"tag":80,"props":2327,"children":2328},{"style":196},[2329],{"type":58,"value":795},{"type":52,"tag":80,"props":2331,"children":2332},{"style":103},[2333],{"type":58,"value":1027},{"type":52,"tag":80,"props":2335,"children":2336},{"class":82,"line":884},[2337],{"type":52,"tag":80,"props":2338,"children":2339},{"style":103},[2340],{"type":58,"value":2341},"  };\n",{"type":52,"tag":80,"props":2343,"children":2344},{"class":82,"line":945},[2345],{"type":52,"tag":80,"props":2346,"children":2347},{"style":103},[2348],{"type":58,"value":2349},"}\n",{"type":52,"tag":68,"props":2351,"children":2353},{"className":70,"code":2352,"language":72,"meta":73,"style":73},"\u002F\u002F server\u002Ftrpc.ts\nimport { initTRPC } from '@trpc\u002Fserver';\nimport { createMyPlugin } from '.\u002FmyPlugin';\n\nconst t = initTRPC.context\u003C{}>().create();\nconst plugin = createMyPlugin();\n\nexport const publicProcedure = t.procedure;\n\nexport const procedureWithPlugin = publicProcedure.concat(plugin.pluginProc);\n",[2354],{"type":52,"tag":76,"props":2355,"children":2356},{"__ignoreMap":73},[2357,2364,2403,2443,2450,2501,2529,2536,2571,2578],{"type":52,"tag":80,"props":2358,"children":2359},{"class":82,"line":83},[2360],{"type":52,"tag":80,"props":2361,"children":2362},{"style":87},[2363],{"type":58,"value":90},{"type":52,"tag":80,"props":2365,"children":2366},{"class":82,"line":93},[2367,2371,2375,2379,2383,2387,2391,2395,2399],{"type":52,"tag":80,"props":2368,"children":2369},{"style":97},[2370],{"type":58,"value":100},{"type":52,"tag":80,"props":2372,"children":2373},{"style":103},[2374],{"type":58,"value":106},{"type":52,"tag":80,"props":2376,"children":2377},{"style":109},[2378],{"type":58,"value":112},{"type":52,"tag":80,"props":2380,"children":2381},{"style":103},[2382],{"type":58,"value":127},{"type":52,"tag":80,"props":2384,"children":2385},{"style":97},[2386],{"type":58,"value":132},{"type":52,"tag":80,"props":2388,"children":2389},{"style":103},[2390],{"type":58,"value":137},{"type":52,"tag":80,"props":2392,"children":2393},{"style":140},[2394],{"type":58,"value":143},{"type":52,"tag":80,"props":2396,"children":2397},{"style":103},[2398],{"type":58,"value":148},{"type":52,"tag":80,"props":2400,"children":2401},{"style":103},[2402],{"type":58,"value":153},{"type":52,"tag":80,"props":2404,"children":2405},{"class":82,"line":156},[2406,2410,2414,2418,2422,2426,2430,2435,2439],{"type":52,"tag":80,"props":2407,"children":2408},{"style":97},[2409],{"type":58,"value":100},{"type":52,"tag":80,"props":2411,"children":2412},{"style":103},[2413],{"type":58,"value":106},{"type":52,"tag":80,"props":2415,"children":2416},{"style":109},[2417],{"type":58,"value":2060},{"type":52,"tag":80,"props":2419,"children":2420},{"style":103},[2421],{"type":58,"value":127},{"type":52,"tag":80,"props":2423,"children":2424},{"style":97},[2425],{"type":58,"value":132},{"type":52,"tag":80,"props":2427,"children":2428},{"style":103},[2429],{"type":58,"value":137},{"type":52,"tag":80,"props":2431,"children":2432},{"style":140},[2433],{"type":58,"value":2434},".\u002FmyPlugin",{"type":52,"tag":80,"props":2436,"children":2437},{"style":103},[2438],{"type":58,"value":148},{"type":52,"tag":80,"props":2440,"children":2441},{"style":103},[2442],{"type":58,"value":153},{"type":52,"tag":80,"props":2444,"children":2445},{"class":82,"line":166},[2446],{"type":52,"tag":80,"props":2447,"children":2448},{"emptyLinePlaceholder":160},[2449],{"type":58,"value":163},{"type":52,"tag":80,"props":2451,"children":2452},{"class":82,"line":192},[2453,2457,2461,2465,2469,2473,2477,2481,2485,2489,2493,2497],{"type":52,"tag":80,"props":2454,"children":2455},{"style":170},[2456],{"type":58,"value":273},{"type":52,"tag":80,"props":2458,"children":2459},{"style":109},[2460],{"type":58,"value":278},{"type":52,"tag":80,"props":2462,"children":2463},{"style":103},[2464],{"type":58,"value":283},{"type":52,"tag":80,"props":2466,"children":2467},{"style":109},[2468],{"type":58,"value":112},{"type":52,"tag":80,"props":2470,"children":2471},{"style":103},[2472],{"type":58,"value":292},{"type":52,"tag":80,"props":2474,"children":2475},{"style":295},[2476],{"type":58,"value":298},{"type":52,"tag":80,"props":2478,"children":2479},{"style":103},[2480],{"type":58,"value":2100},{"type":52,"tag":80,"props":2482,"children":2483},{"style":109},[2484],{"type":58,"value":318},{"type":52,"tag":80,"props":2486,"children":2487},{"style":103},[2488],{"type":58,"value":292},{"type":52,"tag":80,"props":2490,"children":2491},{"style":295},[2492],{"type":58,"value":327},{"type":52,"tag":80,"props":2494,"children":2495},{"style":109},[2496],{"type":58,"value":318},{"type":52,"tag":80,"props":2498,"children":2499},{"style":103},[2500],{"type":58,"value":153},{"type":52,"tag":80,"props":2502,"children":2503},{"class":82,"line":250},[2504,2508,2513,2517,2521,2525],{"type":52,"tag":80,"props":2505,"children":2506},{"style":170},[2507],{"type":58,"value":273},{"type":52,"tag":80,"props":2509,"children":2510},{"style":109},[2511],{"type":58,"value":2512}," plugin ",{"type":52,"tag":80,"props":2514,"children":2515},{"style":103},[2516],{"type":58,"value":283},{"type":52,"tag":80,"props":2518,"children":2519},{"style":295},[2520],{"type":58,"value":2060},{"type":52,"tag":80,"props":2522,"children":2523},{"style":109},[2524],{"type":58,"value":318},{"type":52,"tag":80,"props":2526,"children":2527},{"style":103},[2528],{"type":58,"value":153},{"type":52,"tag":80,"props":2530,"children":2531},{"class":82,"line":259},[2532],{"type":52,"tag":80,"props":2533,"children":2534},{"emptyLinePlaceholder":160},[2535],{"type":58,"value":163},{"type":52,"tag":80,"props":2537,"children":2538},{"class":82,"line":267},[2539,2543,2547,2551,2555,2559,2563,2567],{"type":52,"tag":80,"props":2540,"children":2541},{"style":97},[2542],{"type":58,"value":352},{"type":52,"tag":80,"props":2544,"children":2545},{"style":170},[2546],{"type":58,"value":357},{"type":52,"tag":80,"props":2548,"children":2549},{"style":109},[2550],{"type":58,"value":401},{"type":52,"tag":80,"props":2552,"children":2553},{"style":103},[2554],{"type":58,"value":283},{"type":52,"tag":80,"props":2556,"children":2557},{"style":109},[2558],{"type":58,"value":371},{"type":52,"tag":80,"props":2560,"children":2561},{"style":103},[2562],{"type":58,"value":292},{"type":52,"tag":80,"props":2564,"children":2565},{"style":109},[2566],{"type":58,"value":418},{"type":52,"tag":80,"props":2568,"children":2569},{"style":103},[2570],{"type":58,"value":153},{"type":52,"tag":80,"props":2572,"children":2573},{"class":82,"line":338},[2574],{"type":52,"tag":80,"props":2575,"children":2576},{"emptyLinePlaceholder":160},[2577],{"type":58,"value":163},{"type":52,"tag":80,"props":2579,"children":2580},{"class":82,"line":346},[2581,2585,2589,2594,2598,2603,2607,2612,2617,2621,2626],{"type":52,"tag":80,"props":2582,"children":2583},{"style":97},[2584],{"type":58,"value":352},{"type":52,"tag":80,"props":2586,"children":2587},{"style":170},[2588],{"type":58,"value":357},{"type":52,"tag":80,"props":2590,"children":2591},{"style":109},[2592],{"type":58,"value":2593}," procedureWithPlugin ",{"type":52,"tag":80,"props":2595,"children":2596},{"style":103},[2597],{"type":58,"value":283},{"type":52,"tag":80,"props":2599,"children":2600},{"style":109},[2601],{"type":58,"value":2602}," publicProcedure",{"type":52,"tag":80,"props":2604,"children":2605},{"style":103},[2606],{"type":58,"value":292},{"type":52,"tag":80,"props":2608,"children":2609},{"style":295},[2610],{"type":58,"value":2611},"concat",{"type":52,"tag":80,"props":2613,"children":2614},{"style":109},[2615],{"type":58,"value":2616},"(plugin",{"type":52,"tag":80,"props":2618,"children":2619},{"style":103},[2620],{"type":58,"value":292},{"type":52,"tag":80,"props":2622,"children":2623},{"style":109},[2624],{"type":58,"value":2625},"pluginProc)",{"type":52,"tag":80,"props":2627,"children":2628},{"style":103},[2629],{"type":58,"value":153},{"type":52,"tag":1403,"props":2631,"children":2632},{},[2633,2639],{"type":52,"tag":76,"props":2634,"children":2636},{"className":2635},[],[2637],{"type":58,"value":2638},".concat()",{"type":58,"value":2640}," merges a partial procedure (from any tRPC instance) into your procedure chain, as long as context and meta types overlap.",{"type":52,"tag":467,"props":2642,"children":2644},{"id":2643},"extending-middlewares-with-unstable_pipe",[2645],{"type":58,"value":2646},"Extending middlewares with .unstable_pipe()",{"type":52,"tag":68,"props":2648,"children":2650},{"className":70,"code":2649,"language":72,"meta":73,"style":73},"import { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst fooMiddleware = t.middleware((opts) => {\n  return opts.next({\n    ctx: { foo: 'foo' as const },\n  });\n});\n\nconst barMiddleware = fooMiddleware.unstable_pipe((opts) => {\n  console.log(opts.ctx.foo);\n  return opts.next({\n    ctx: { bar: 'bar' as const },\n  });\n});\n\nconst barProcedure = t.procedure.use(barMiddleware);\n",[2651],{"type":52,"tag":76,"props":2652,"children":2653},{"__ignoreMap":73},[2654,2693,2700,2735,2742,2794,2821,2871,2886,2901,2908,2962,3010,3037,3086,3101,3116,3123],{"type":52,"tag":80,"props":2655,"children":2656},{"class":82,"line":83},[2657,2661,2665,2669,2673,2677,2681,2685,2689],{"type":52,"tag":80,"props":2658,"children":2659},{"style":97},[2660],{"type":58,"value":100},{"type":52,"tag":80,"props":2662,"children":2663},{"style":103},[2664],{"type":58,"value":106},{"type":52,"tag":80,"props":2666,"children":2667},{"style":109},[2668],{"type":58,"value":112},{"type":52,"tag":80,"props":2670,"children":2671},{"style":103},[2672],{"type":58,"value":127},{"type":52,"tag":80,"props":2674,"children":2675},{"style":97},[2676],{"type":58,"value":132},{"type":52,"tag":80,"props":2678,"children":2679},{"style":103},[2680],{"type":58,"value":137},{"type":52,"tag":80,"props":2682,"children":2683},{"style":140},[2684],{"type":58,"value":143},{"type":52,"tag":80,"props":2686,"children":2687},{"style":103},[2688],{"type":58,"value":148},{"type":52,"tag":80,"props":2690,"children":2691},{"style":103},[2692],{"type":58,"value":153},{"type":52,"tag":80,"props":2694,"children":2695},{"class":82,"line":93},[2696],{"type":52,"tag":80,"props":2697,"children":2698},{"emptyLinePlaceholder":160},[2699],{"type":58,"value":163},{"type":52,"tag":80,"props":2701,"children":2702},{"class":82,"line":156},[2703,2707,2711,2715,2719,2723,2727,2731],{"type":52,"tag":80,"props":2704,"children":2705},{"style":170},[2706],{"type":58,"value":273},{"type":52,"tag":80,"props":2708,"children":2709},{"style":109},[2710],{"type":58,"value":278},{"type":52,"tag":80,"props":2712,"children":2713},{"style":103},[2714],{"type":58,"value":283},{"type":52,"tag":80,"props":2716,"children":2717},{"style":109},[2718],{"type":58,"value":112},{"type":52,"tag":80,"props":2720,"children":2721},{"style":103},[2722],{"type":58,"value":292},{"type":52,"tag":80,"props":2724,"children":2725},{"style":295},[2726],{"type":58,"value":327},{"type":52,"tag":80,"props":2728,"children":2729},{"style":109},[2730],{"type":58,"value":318},{"type":52,"tag":80,"props":2732,"children":2733},{"style":103},[2734],{"type":58,"value":153},{"type":52,"tag":80,"props":2736,"children":2737},{"class":82,"line":166},[2738],{"type":52,"tag":80,"props":2739,"children":2740},{"emptyLinePlaceholder":160},[2741],{"type":58,"value":163},{"type":52,"tag":80,"props":2743,"children":2744},{"class":82,"line":192},[2745,2749,2754,2758,2762,2766,2770,2774,2778,2782,2786,2790],{"type":52,"tag":80,"props":2746,"children":2747},{"style":170},[2748],{"type":58,"value":273},{"type":52,"tag":80,"props":2750,"children":2751},{"style":109},[2752],{"type":58,"value":2753}," fooMiddleware ",{"type":52,"tag":80,"props":2755,"children":2756},{"style":103},[2757],{"type":58,"value":283},{"type":52,"tag":80,"props":2759,"children":2760},{"style":109},[2761],{"type":58,"value":371},{"type":52,"tag":80,"props":2763,"children":2764},{"style":103},[2765],{"type":58,"value":292},{"type":52,"tag":80,"props":2767,"children":2768},{"style":295},[2769],{"type":58,"value":19},{"type":52,"tag":80,"props":2771,"children":2772},{"style":109},[2773],{"type":58,"value":774},{"type":52,"tag":80,"props":2775,"children":2776},{"style":103},[2777],{"type":58,"value":774},{"type":52,"tag":80,"props":2779,"children":2780},{"style":787},[2781],{"type":58,"value":790},{"type":52,"tag":80,"props":2783,"children":2784},{"style":103},[2785],{"type":58,"value":795},{"type":52,"tag":80,"props":2787,"children":2788},{"style":170},[2789],{"type":58,"value":800},{"type":52,"tag":80,"props":2791,"children":2792},{"style":103},[2793],{"type":58,"value":189},{"type":52,"tag":80,"props":2795,"children":2796},{"class":82,"line":250},[2797,2801,2805,2809,2813,2817],{"type":52,"tag":80,"props":2798,"children":2799},{"style":97},[2800],{"type":58,"value":960},{"type":52,"tag":80,"props":2802,"children":2803},{"style":109},[2804],{"type":58,"value":835},{"type":52,"tag":80,"props":2806,"children":2807},{"style":103},[2808],{"type":58,"value":292},{"type":52,"tag":80,"props":2810,"children":2811},{"style":295},[2812],{"type":58,"value":27},{"type":52,"tag":80,"props":2814,"children":2815},{"style":196},[2816],{"type":58,"value":774},{"type":52,"tag":80,"props":2818,"children":2819},{"style":103},[2820],{"type":58,"value":881},{"type":52,"tag":80,"props":2822,"children":2823},{"class":82,"line":259},[2824,2828,2832,2836,2841,2845,2849,2854,2858,2862,2866],{"type":52,"tag":80,"props":2825,"children":2826},{"style":196},[2827],{"type":58,"value":989},{"type":52,"tag":80,"props":2829,"children":2830},{"style":103},[2831],{"type":58,"value":218},{"type":52,"tag":80,"props":2833,"children":2834},{"style":103},[2835],{"type":58,"value":106},{"type":52,"tag":80,"props":2837,"children":2838},{"style":196},[2839],{"type":58,"value":2840}," foo",{"type":52,"tag":80,"props":2842,"children":2843},{"style":103},[2844],{"type":58,"value":218},{"type":52,"tag":80,"props":2846,"children":2847},{"style":103},[2848],{"type":58,"value":137},{"type":52,"tag":80,"props":2850,"children":2851},{"style":140},[2852],{"type":58,"value":2853},"foo",{"type":52,"tag":80,"props":2855,"children":2856},{"style":103},[2857],{"type":58,"value":148},{"type":52,"tag":80,"props":2859,"children":2860},{"style":97},[2861],{"type":58,"value":2285},{"type":52,"tag":80,"props":2863,"children":2864},{"style":170},[2865],{"type":58,"value":357},{"type":52,"tag":80,"props":2867,"children":2868},{"style":103},[2869],{"type":58,"value":2870}," },\n",{"type":52,"tag":80,"props":2872,"children":2873},{"class":82,"line":267},[2874,2878,2882],{"type":52,"tag":80,"props":2875,"children":2876},{"style":103},[2877],{"type":58,"value":1045},{"type":52,"tag":80,"props":2879,"children":2880},{"style":196},[2881],{"type":58,"value":795},{"type":52,"tag":80,"props":2883,"children":2884},{"style":103},[2885],{"type":58,"value":153},{"type":52,"tag":80,"props":2887,"children":2888},{"class":82,"line":338},[2889,2893,2897],{"type":52,"tag":80,"props":2890,"children":2891},{"style":103},[2892],{"type":58,"value":1062},{"type":52,"tag":80,"props":2894,"children":2895},{"style":109},[2896],{"type":58,"value":795},{"type":52,"tag":80,"props":2898,"children":2899},{"style":103},[2900],{"type":58,"value":153},{"type":52,"tag":80,"props":2902,"children":2903},{"class":82,"line":346},[2904],{"type":52,"tag":80,"props":2905,"children":2906},{"emptyLinePlaceholder":160},[2907],{"type":58,"value":163},{"type":52,"tag":80,"props":2909,"children":2910},{"class":82,"line":387},[2911,2915,2920,2924,2929,2933,2938,2942,2946,2950,2954,2958],{"type":52,"tag":80,"props":2912,"children":2913},{"style":170},[2914],{"type":58,"value":273},{"type":52,"tag":80,"props":2916,"children":2917},{"style":109},[2918],{"type":58,"value":2919}," barMiddleware ",{"type":52,"tag":80,"props":2921,"children":2922},{"style":103},[2923],{"type":58,"value":283},{"type":52,"tag":80,"props":2925,"children":2926},{"style":109},[2927],{"type":58,"value":2928}," fooMiddleware",{"type":52,"tag":80,"props":2930,"children":2931},{"style":103},[2932],{"type":58,"value":292},{"type":52,"tag":80,"props":2934,"children":2935},{"style":295},[2936],{"type":58,"value":2937},"unstable_pipe",{"type":52,"tag":80,"props":2939,"children":2940},{"style":109},[2941],{"type":58,"value":774},{"type":52,"tag":80,"props":2943,"children":2944},{"style":103},[2945],{"type":58,"value":774},{"type":52,"tag":80,"props":2947,"children":2948},{"style":787},[2949],{"type":58,"value":790},{"type":52,"tag":80,"props":2951,"children":2952},{"style":103},[2953],{"type":58,"value":795},{"type":52,"tag":80,"props":2955,"children":2956},{"style":170},[2957],{"type":58,"value":800},{"type":52,"tag":80,"props":2959,"children":2960},{"style":103},[2961],{"type":58,"value":189},{"type":52,"tag":80,"props":2963,"children":2964},{"class":82,"line":425},[2965,2970,2974,2978,2982,2986,2990,2994,2998,3002,3006],{"type":52,"tag":80,"props":2966,"children":2967},{"style":109},[2968],{"type":58,"value":2969},"  console",{"type":52,"tag":80,"props":2971,"children":2972},{"style":103},[2973],{"type":58,"value":292},{"type":52,"tag":80,"props":2975,"children":2976},{"style":295},[2977],{"type":58,"value":1855},{"type":52,"tag":80,"props":2979,"children":2980},{"style":196},[2981],{"type":58,"value":774},{"type":52,"tag":80,"props":2983,"children":2984},{"style":109},[2985],{"type":58,"value":790},{"type":52,"tag":80,"props":2987,"children":2988},{"style":103},[2989],{"type":58,"value":292},{"type":52,"tag":80,"props":2991,"children":2992},{"style":109},[2993],{"type":58,"value":862},{"type":52,"tag":80,"props":2995,"children":2996},{"style":103},[2997],{"type":58,"value":292},{"type":52,"tag":80,"props":2999,"children":3000},{"style":109},[3001],{"type":58,"value":2853},{"type":52,"tag":80,"props":3003,"children":3004},{"style":196},[3005],{"type":58,"value":795},{"type":52,"tag":80,"props":3007,"children":3008},{"style":103},[3009],{"type":58,"value":153},{"type":52,"tag":80,"props":3011,"children":3012},{"class":82,"line":807},[3013,3017,3021,3025,3029,3033],{"type":52,"tag":80,"props":3014,"children":3015},{"style":97},[3016],{"type":58,"value":960},{"type":52,"tag":80,"props":3018,"children":3019},{"style":109},[3020],{"type":58,"value":835},{"type":52,"tag":80,"props":3022,"children":3023},{"style":103},[3024],{"type":58,"value":292},{"type":52,"tag":80,"props":3026,"children":3027},{"style":295},[3028],{"type":58,"value":27},{"type":52,"tag":80,"props":3030,"children":3031},{"style":196},[3032],{"type":58,"value":774},{"type":52,"tag":80,"props":3034,"children":3035},{"style":103},[3036],{"type":58,"value":881},{"type":52,"tag":80,"props":3038,"children":3039},{"class":82,"line":842},[3040,3044,3048,3052,3057,3061,3065,3070,3074,3078,3082],{"type":52,"tag":80,"props":3041,"children":3042},{"style":196},[3043],{"type":58,"value":989},{"type":52,"tag":80,"props":3045,"children":3046},{"style":103},[3047],{"type":58,"value":218},{"type":52,"tag":80,"props":3049,"children":3050},{"style":103},[3051],{"type":58,"value":106},{"type":52,"tag":80,"props":3053,"children":3054},{"style":196},[3055],{"type":58,"value":3056}," bar",{"type":52,"tag":80,"props":3058,"children":3059},{"style":103},[3060],{"type":58,"value":218},{"type":52,"tag":80,"props":3062,"children":3063},{"style":103},[3064],{"type":58,"value":137},{"type":52,"tag":80,"props":3066,"children":3067},{"style":140},[3068],{"type":58,"value":3069},"bar",{"type":52,"tag":80,"props":3071,"children":3072},{"style":103},[3073],{"type":58,"value":148},{"type":52,"tag":80,"props":3075,"children":3076},{"style":97},[3077],{"type":58,"value":2285},{"type":52,"tag":80,"props":3079,"children":3080},{"style":170},[3081],{"type":58,"value":357},{"type":52,"tag":80,"props":3083,"children":3084},{"style":103},[3085],{"type":58,"value":2870},{"type":52,"tag":80,"props":3087,"children":3088},{"class":82,"line":884},[3089,3093,3097],{"type":52,"tag":80,"props":3090,"children":3091},{"style":103},[3092],{"type":58,"value":1045},{"type":52,"tag":80,"props":3094,"children":3095},{"style":196},[3096],{"type":58,"value":795},{"type":52,"tag":80,"props":3098,"children":3099},{"style":103},[3100],{"type":58,"value":153},{"type":52,"tag":80,"props":3102,"children":3103},{"class":82,"line":945},[3104,3108,3112],{"type":52,"tag":80,"props":3105,"children":3106},{"style":103},[3107],{"type":58,"value":1062},{"type":52,"tag":80,"props":3109,"children":3110},{"style":109},[3111],{"type":58,"value":795},{"type":52,"tag":80,"props":3113,"children":3114},{"style":103},[3115],{"type":58,"value":153},{"type":52,"tag":80,"props":3117,"children":3118},{"class":82,"line":954},[3119],{"type":52,"tag":80,"props":3120,"children":3121},{"emptyLinePlaceholder":160},[3122],{"type":58,"value":163},{"type":52,"tag":80,"props":3124,"children":3125},{"class":82,"line":983},[3126,3130,3135,3139,3143,3147,3151,3155,3159,3164],{"type":52,"tag":80,"props":3127,"children":3128},{"style":170},[3129],{"type":58,"value":273},{"type":52,"tag":80,"props":3131,"children":3132},{"style":109},[3133],{"type":58,"value":3134}," barProcedure ",{"type":52,"tag":80,"props":3136,"children":3137},{"style":103},[3138],{"type":58,"value":283},{"type":52,"tag":80,"props":3140,"children":3141},{"style":109},[3142],{"type":58,"value":371},{"type":52,"tag":80,"props":3144,"children":3145},{"style":103},[3146],{"type":58,"value":292},{"type":52,"tag":80,"props":3148,"children":3149},{"style":109},[3150],{"type":58,"value":418},{"type":52,"tag":80,"props":3152,"children":3153},{"style":103},[3154],{"type":58,"value":292},{"type":52,"tag":80,"props":3156,"children":3157},{"style":295},[3158],{"type":58,"value":769},{"type":52,"tag":80,"props":3160,"children":3161},{"style":109},[3162],{"type":58,"value":3163},"(barMiddleware)",{"type":52,"tag":80,"props":3165,"children":3166},{"style":103},[3167],{"type":58,"value":153},{"type":52,"tag":1403,"props":3169,"children":3170},{},[3171],{"type":58,"value":3172},"Piped middlewares run in order and each receives the context from the previous middleware.",{"type":52,"tag":61,"props":3174,"children":3176},{"id":3175},"common-mistakes",[3177],{"type":58,"value":3178},"Common Mistakes",{"type":52,"tag":467,"props":3180,"children":3182},{"id":3181},"critical-forgetting-to-call-and-return-optsnext",[3183,3188],{"type":52,"tag":80,"props":3184,"children":3185},{},[3186],{"type":58,"value":3187},"CRITICAL",{"type":58,"value":3189}," Forgetting to call and return opts.next()",{"type":52,"tag":1403,"props":3191,"children":3192},{},[3193],{"type":58,"value":3194},"Wrong:",{"type":52,"tag":68,"props":3196,"children":3198},{"className":70,"code":3197,"language":72,"meta":73,"style":73},"import { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst logMiddleware = t.middleware(async (opts) => {\n  console.log('request started');\n  \u002F\u002F forgot to call opts.next()\n});\n",[3199],{"type":52,"tag":76,"props":3200,"children":3201},{"__ignoreMap":73},[3202,3241,3248,3283,3290,3346,3386,3394],{"type":52,"tag":80,"props":3203,"children":3204},{"class":82,"line":83},[3205,3209,3213,3217,3221,3225,3229,3233,3237],{"type":52,"tag":80,"props":3206,"children":3207},{"style":97},[3208],{"type":58,"value":100},{"type":52,"tag":80,"props":3210,"children":3211},{"style":103},[3212],{"type":58,"value":106},{"type":52,"tag":80,"props":3214,"children":3215},{"style":109},[3216],{"type":58,"value":112},{"type":52,"tag":80,"props":3218,"children":3219},{"style":103},[3220],{"type":58,"value":127},{"type":52,"tag":80,"props":3222,"children":3223},{"style":97},[3224],{"type":58,"value":132},{"type":52,"tag":80,"props":3226,"children":3227},{"style":103},[3228],{"type":58,"value":137},{"type":52,"tag":80,"props":3230,"children":3231},{"style":140},[3232],{"type":58,"value":143},{"type":52,"tag":80,"props":3234,"children":3235},{"style":103},[3236],{"type":58,"value":148},{"type":52,"tag":80,"props":3238,"children":3239},{"style":103},[3240],{"type":58,"value":153},{"type":52,"tag":80,"props":3242,"children":3243},{"class":82,"line":93},[3244],{"type":52,"tag":80,"props":3245,"children":3246},{"emptyLinePlaceholder":160},[3247],{"type":58,"value":163},{"type":52,"tag":80,"props":3249,"children":3250},{"class":82,"line":156},[3251,3255,3259,3263,3267,3271,3275,3279],{"type":52,"tag":80,"props":3252,"children":3253},{"style":170},[3254],{"type":58,"value":273},{"type":52,"tag":80,"props":3256,"children":3257},{"style":109},[3258],{"type":58,"value":278},{"type":52,"tag":80,"props":3260,"children":3261},{"style":103},[3262],{"type":58,"value":283},{"type":52,"tag":80,"props":3264,"children":3265},{"style":109},[3266],{"type":58,"value":112},{"type":52,"tag":80,"props":3268,"children":3269},{"style":103},[3270],{"type":58,"value":292},{"type":52,"tag":80,"props":3272,"children":3273},{"style":295},[3274],{"type":58,"value":327},{"type":52,"tag":80,"props":3276,"children":3277},{"style":109},[3278],{"type":58,"value":318},{"type":52,"tag":80,"props":3280,"children":3281},{"style":103},[3282],{"type":58,"value":153},{"type":52,"tag":80,"props":3284,"children":3285},{"class":82,"line":166},[3286],{"type":52,"tag":80,"props":3287,"children":3288},{"emptyLinePlaceholder":160},[3289],{"type":58,"value":163},{"type":52,"tag":80,"props":3291,"children":3292},{"class":82,"line":192},[3293,3297,3302,3306,3310,3314,3318,3322,3326,3330,3334,3338,3342],{"type":52,"tag":80,"props":3294,"children":3295},{"style":170},[3296],{"type":58,"value":273},{"type":52,"tag":80,"props":3298,"children":3299},{"style":109},[3300],{"type":58,"value":3301}," logMiddleware ",{"type":52,"tag":80,"props":3303,"children":3304},{"style":103},[3305],{"type":58,"value":283},{"type":52,"tag":80,"props":3307,"children":3308},{"style":109},[3309],{"type":58,"value":371},{"type":52,"tag":80,"props":3311,"children":3312},{"style":103},[3313],{"type":58,"value":292},{"type":52,"tag":80,"props":3315,"children":3316},{"style":295},[3317],{"type":58,"value":19},{"type":52,"tag":80,"props":3319,"children":3320},{"style":109},[3321],{"type":58,"value":774},{"type":52,"tag":80,"props":3323,"children":3324},{"style":170},[3325],{"type":58,"value":779},{"type":52,"tag":80,"props":3327,"children":3328},{"style":103},[3329],{"type":58,"value":784},{"type":52,"tag":80,"props":3331,"children":3332},{"style":787},[3333],{"type":58,"value":790},{"type":52,"tag":80,"props":3335,"children":3336},{"style":103},[3337],{"type":58,"value":795},{"type":52,"tag":80,"props":3339,"children":3340},{"style":170},[3341],{"type":58,"value":800},{"type":52,"tag":80,"props":3343,"children":3344},{"style":103},[3345],{"type":58,"value":189},{"type":52,"tag":80,"props":3347,"children":3348},{"class":82,"line":250},[3349,3353,3357,3361,3365,3369,3374,3378,3382],{"type":52,"tag":80,"props":3350,"children":3351},{"style":109},[3352],{"type":58,"value":2969},{"type":52,"tag":80,"props":3354,"children":3355},{"style":103},[3356],{"type":58,"value":292},{"type":52,"tag":80,"props":3358,"children":3359},{"style":295},[3360],{"type":58,"value":1855},{"type":52,"tag":80,"props":3362,"children":3363},{"style":196},[3364],{"type":58,"value":774},{"type":52,"tag":80,"props":3366,"children":3367},{"style":103},[3368],{"type":58,"value":148},{"type":52,"tag":80,"props":3370,"children":3371},{"style":140},[3372],{"type":58,"value":3373},"request started",{"type":52,"tag":80,"props":3375,"children":3376},{"style":103},[3377],{"type":58,"value":148},{"type":52,"tag":80,"props":3379,"children":3380},{"style":196},[3381],{"type":58,"value":795},{"type":52,"tag":80,"props":3383,"children":3384},{"style":103},[3385],{"type":58,"value":153},{"type":52,"tag":80,"props":3387,"children":3388},{"class":82,"line":259},[3389],{"type":52,"tag":80,"props":3390,"children":3391},{"style":87},[3392],{"type":58,"value":3393},"  \u002F\u002F forgot to call opts.next()\n",{"type":52,"tag":80,"props":3395,"children":3396},{"class":82,"line":267},[3397,3401,3405],{"type":52,"tag":80,"props":3398,"children":3399},{"style":103},[3400],{"type":58,"value":1062},{"type":52,"tag":80,"props":3402,"children":3403},{"style":109},[3404],{"type":58,"value":795},{"type":52,"tag":80,"props":3406,"children":3407},{"style":103},[3408],{"type":58,"value":153},{"type":52,"tag":1403,"props":3410,"children":3411},{},[3412],{"type":58,"value":3413},"Correct:",{"type":52,"tag":68,"props":3415,"children":3417},{"className":70,"code":3416,"language":72,"meta":73,"style":73},"import { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst logMiddleware = t.middleware(async (opts) => {\n  console.log('request started');\n  const result = await opts.next();\n  console.log('request ended');\n  return result;\n});\n",[3418],{"type":52,"tag":76,"props":3419,"children":3420},{"__ignoreMap":73},[3421,3460,3467,3502,3509,3564,3603,3642,3682,3697],{"type":52,"tag":80,"props":3422,"children":3423},{"class":82,"line":83},[3424,3428,3432,3436,3440,3444,3448,3452,3456],{"type":52,"tag":80,"props":3425,"children":3426},{"style":97},[3427],{"type":58,"value":100},{"type":52,"tag":80,"props":3429,"children":3430},{"style":103},[3431],{"type":58,"value":106},{"type":52,"tag":80,"props":3433,"children":3434},{"style":109},[3435],{"type":58,"value":112},{"type":52,"tag":80,"props":3437,"children":3438},{"style":103},[3439],{"type":58,"value":127},{"type":52,"tag":80,"props":3441,"children":3442},{"style":97},[3443],{"type":58,"value":132},{"type":52,"tag":80,"props":3445,"children":3446},{"style":103},[3447],{"type":58,"value":137},{"type":52,"tag":80,"props":3449,"children":3450},{"style":140},[3451],{"type":58,"value":143},{"type":52,"tag":80,"props":3453,"children":3454},{"style":103},[3455],{"type":58,"value":148},{"type":52,"tag":80,"props":3457,"children":3458},{"style":103},[3459],{"type":58,"value":153},{"type":52,"tag":80,"props":3461,"children":3462},{"class":82,"line":93},[3463],{"type":52,"tag":80,"props":3464,"children":3465},{"emptyLinePlaceholder":160},[3466],{"type":58,"value":163},{"type":52,"tag":80,"props":3468,"children":3469},{"class":82,"line":156},[3470,3474,3478,3482,3486,3490,3494,3498],{"type":52,"tag":80,"props":3471,"children":3472},{"style":170},[3473],{"type":58,"value":273},{"type":52,"tag":80,"props":3475,"children":3476},{"style":109},[3477],{"type":58,"value":278},{"type":52,"tag":80,"props":3479,"children":3480},{"style":103},[3481],{"type":58,"value":283},{"type":52,"tag":80,"props":3483,"children":3484},{"style":109},[3485],{"type":58,"value":112},{"type":52,"tag":80,"props":3487,"children":3488},{"style":103},[3489],{"type":58,"value":292},{"type":52,"tag":80,"props":3491,"children":3492},{"style":295},[3493],{"type":58,"value":327},{"type":52,"tag":80,"props":3495,"children":3496},{"style":109},[3497],{"type":58,"value":318},{"type":52,"tag":80,"props":3499,"children":3500},{"style":103},[3501],{"type":58,"value":153},{"type":52,"tag":80,"props":3503,"children":3504},{"class":82,"line":166},[3505],{"type":52,"tag":80,"props":3506,"children":3507},{"emptyLinePlaceholder":160},[3508],{"type":58,"value":163},{"type":52,"tag":80,"props":3510,"children":3511},{"class":82,"line":192},[3512,3516,3520,3524,3528,3532,3536,3540,3544,3548,3552,3556,3560],{"type":52,"tag":80,"props":3513,"children":3514},{"style":170},[3515],{"type":58,"value":273},{"type":52,"tag":80,"props":3517,"children":3518},{"style":109},[3519],{"type":58,"value":3301},{"type":52,"tag":80,"props":3521,"children":3522},{"style":103},[3523],{"type":58,"value":283},{"type":52,"tag":80,"props":3525,"children":3526},{"style":109},[3527],{"type":58,"value":371},{"type":52,"tag":80,"props":3529,"children":3530},{"style":103},[3531],{"type":58,"value":292},{"type":52,"tag":80,"props":3533,"children":3534},{"style":295},[3535],{"type":58,"value":19},{"type":52,"tag":80,"props":3537,"children":3538},{"style":109},[3539],{"type":58,"value":774},{"type":52,"tag":80,"props":3541,"children":3542},{"style":170},[3543],{"type":58,"value":779},{"type":52,"tag":80,"props":3545,"children":3546},{"style":103},[3547],{"type":58,"value":784},{"type":52,"tag":80,"props":3549,"children":3550},{"style":787},[3551],{"type":58,"value":790},{"type":52,"tag":80,"props":3553,"children":3554},{"style":103},[3555],{"type":58,"value":795},{"type":52,"tag":80,"props":3557,"children":3558},{"style":170},[3559],{"type":58,"value":800},{"type":52,"tag":80,"props":3561,"children":3562},{"style":103},[3563],{"type":58,"value":189},{"type":52,"tag":80,"props":3565,"children":3566},{"class":82,"line":250},[3567,3571,3575,3579,3583,3587,3591,3595,3599],{"type":52,"tag":80,"props":3568,"children":3569},{"style":109},[3570],{"type":58,"value":2969},{"type":52,"tag":80,"props":3572,"children":3573},{"style":103},[3574],{"type":58,"value":292},{"type":52,"tag":80,"props":3576,"children":3577},{"style":295},[3578],{"type":58,"value":1855},{"type":52,"tag":80,"props":3580,"children":3581},{"style":196},[3582],{"type":58,"value":774},{"type":52,"tag":80,"props":3584,"children":3585},{"style":103},[3586],{"type":58,"value":148},{"type":52,"tag":80,"props":3588,"children":3589},{"style":140},[3590],{"type":58,"value":3373},{"type":52,"tag":80,"props":3592,"children":3593},{"style":103},[3594],{"type":58,"value":148},{"type":52,"tag":80,"props":3596,"children":3597},{"style":196},[3598],{"type":58,"value":795},{"type":52,"tag":80,"props":3600,"children":3601},{"style":103},[3602],{"type":58,"value":153},{"type":52,"tag":80,"props":3604,"children":3605},{"class":82,"line":259},[3606,3610,3614,3618,3622,3626,3630,3634,3638],{"type":52,"tag":80,"props":3607,"children":3608},{"style":170},[3609],{"type":58,"value":813},{"type":52,"tag":80,"props":3611,"children":3612},{"style":109},[3613],{"type":58,"value":1648},{"type":52,"tag":80,"props":3615,"children":3616},{"style":103},[3617],{"type":58,"value":184},{"type":52,"tag":80,"props":3619,"children":3620},{"style":97},[3621],{"type":58,"value":1657},{"type":52,"tag":80,"props":3623,"children":3624},{"style":109},[3625],{"type":58,"value":835},{"type":52,"tag":80,"props":3627,"children":3628},{"style":103},[3629],{"type":58,"value":292},{"type":52,"tag":80,"props":3631,"children":3632},{"style":295},[3633],{"type":58,"value":27},{"type":52,"tag":80,"props":3635,"children":3636},{"style":196},[3637],{"type":58,"value":318},{"type":52,"tag":80,"props":3639,"children":3640},{"style":103},[3641],{"type":58,"value":153},{"type":52,"tag":80,"props":3643,"children":3644},{"class":82,"line":267},[3645,3649,3653,3657,3661,3665,3670,3674,3678],{"type":52,"tag":80,"props":3646,"children":3647},{"style":109},[3648],{"type":58,"value":2969},{"type":52,"tag":80,"props":3650,"children":3651},{"style":103},[3652],{"type":58,"value":292},{"type":52,"tag":80,"props":3654,"children":3655},{"style":295},[3656],{"type":58,"value":1855},{"type":52,"tag":80,"props":3658,"children":3659},{"style":196},[3660],{"type":58,"value":774},{"type":52,"tag":80,"props":3662,"children":3663},{"style":103},[3664],{"type":58,"value":148},{"type":52,"tag":80,"props":3666,"children":3667},{"style":140},[3668],{"type":58,"value":3669},"request ended",{"type":52,"tag":80,"props":3671,"children":3672},{"style":103},[3673],{"type":58,"value":148},{"type":52,"tag":80,"props":3675,"children":3676},{"style":196},[3677],{"type":58,"value":795},{"type":52,"tag":80,"props":3679,"children":3680},{"style":103},[3681],{"type":58,"value":153},{"type":52,"tag":80,"props":3683,"children":3684},{"class":82,"line":338},[3685,3689,3693],{"type":52,"tag":80,"props":3686,"children":3687},{"style":97},[3688],{"type":58,"value":960},{"type":52,"tag":80,"props":3690,"children":3691},{"style":109},[3692],{"type":58,"value":1648},{"type":52,"tag":80,"props":3694,"children":3695},{"style":103},[3696],{"type":58,"value":153},{"type":52,"tag":80,"props":3698,"children":3699},{"class":82,"line":346},[3700,3704,3708],{"type":52,"tag":80,"props":3701,"children":3702},{"style":103},[3703],{"type":58,"value":1062},{"type":52,"tag":80,"props":3705,"children":3706},{"style":109},[3707],{"type":58,"value":795},{"type":52,"tag":80,"props":3709,"children":3710},{"style":103},[3711],{"type":58,"value":153},{"type":52,"tag":1403,"props":3713,"children":3714},{},[3715,3717,3723],{"type":58,"value":3716},"Middleware must call ",{"type":52,"tag":76,"props":3718,"children":3720},{"className":3719},[],[3721],{"type":58,"value":3722},"opts.next()",{"type":58,"value":3724}," and return its result; forgetting this silently drops the request with an INTERNAL_SERVER_ERROR because no middleware marker is returned.",{"type":52,"tag":1403,"props":3726,"children":3727},{},[3728],{"type":58,"value":3729},"Source: packages\u002Fserver\u002Fsrc\u002Funstable-core-do-not-import\u002FprocedureBuilder.ts",{"type":52,"tag":467,"props":3731,"children":3733},{"id":3732},"high-extending-context-with-wrong-type-in-optsnext",[3734,3739],{"type":52,"tag":80,"props":3735,"children":3736},{},[3737],{"type":58,"value":3738},"HIGH",{"type":58,"value":3740}," Extending context with wrong type in opts.next()",{"type":52,"tag":1403,"props":3742,"children":3743},{},[3744],{"type":58,"value":3194},{"type":52,"tag":68,"props":3746,"children":3748},{"className":70,"code":3747,"language":72,"meta":73,"style":73},"import { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nconst middleware = t.middleware(async (opts) => {\n  return opts.next({ ctx: 'not-an-object' });\n});\n",[3749],{"type":52,"tag":76,"props":3750,"children":3751},{"__ignoreMap":73},[3752,3791,3798,3833,3840,3895,3955],{"type":52,"tag":80,"props":3753,"children":3754},{"class":82,"line":83},[3755,3759,3763,3767,3771,3775,3779,3783,3787],{"type":52,"tag":80,"props":3756,"children":3757},{"style":97},[3758],{"type":58,"value":100},{"type":52,"tag":80,"props":3760,"children":3761},{"style":103},[3762],{"type":58,"value":106},{"type":52,"tag":80,"props":3764,"children":3765},{"style":109},[3766],{"type":58,"value":112},{"type":52,"tag":80,"props":3768,"children":3769},{"style":103},[3770],{"type":58,"value":127},{"type":52,"tag":80,"props":3772,"children":3773},{"style":97},[3774],{"type":58,"value":132},{"type":52,"tag":80,"props":3776,"children":3777},{"style":103},[3778],{"type":58,"value":137},{"type":52,"tag":80,"props":3780,"children":3781},{"style":140},[3782],{"type":58,"value":143},{"type":52,"tag":80,"props":3784,"children":3785},{"style":103},[3786],{"type":58,"value":148},{"type":52,"tag":80,"props":3788,"children":3789},{"style":103},[3790],{"type":58,"value":153},{"type":52,"tag":80,"props":3792,"children":3793},{"class":82,"line":93},[3794],{"type":52,"tag":80,"props":3795,"children":3796},{"emptyLinePlaceholder":160},[3797],{"type":58,"value":163},{"type":52,"tag":80,"props":3799,"children":3800},{"class":82,"line":156},[3801,3805,3809,3813,3817,3821,3825,3829],{"type":52,"tag":80,"props":3802,"children":3803},{"style":170},[3804],{"type":58,"value":273},{"type":52,"tag":80,"props":3806,"children":3807},{"style":109},[3808],{"type":58,"value":278},{"type":52,"tag":80,"props":3810,"children":3811},{"style":103},[3812],{"type":58,"value":283},{"type":52,"tag":80,"props":3814,"children":3815},{"style":109},[3816],{"type":58,"value":112},{"type":52,"tag":80,"props":3818,"children":3819},{"style":103},[3820],{"type":58,"value":292},{"type":52,"tag":80,"props":3822,"children":3823},{"style":295},[3824],{"type":58,"value":327},{"type":52,"tag":80,"props":3826,"children":3827},{"style":109},[3828],{"type":58,"value":318},{"type":52,"tag":80,"props":3830,"children":3831},{"style":103},[3832],{"type":58,"value":153},{"type":52,"tag":80,"props":3834,"children":3835},{"class":82,"line":166},[3836],{"type":52,"tag":80,"props":3837,"children":3838},{"emptyLinePlaceholder":160},[3839],{"type":58,"value":163},{"type":52,"tag":80,"props":3841,"children":3842},{"class":82,"line":192},[3843,3847,3851,3855,3859,3863,3867,3871,3875,3879,3883,3887,3891],{"type":52,"tag":80,"props":3844,"children":3845},{"style":170},[3846],{"type":58,"value":273},{"type":52,"tag":80,"props":3848,"children":3849},{"style":109},[3850],{"type":58,"value":439},{"type":52,"tag":80,"props":3852,"children":3853},{"style":103},[3854],{"type":58,"value":283},{"type":52,"tag":80,"props":3856,"children":3857},{"style":109},[3858],{"type":58,"value":371},{"type":52,"tag":80,"props":3860,"children":3861},{"style":103},[3862],{"type":58,"value":292},{"type":52,"tag":80,"props":3864,"children":3865},{"style":295},[3866],{"type":58,"value":19},{"type":52,"tag":80,"props":3868,"children":3869},{"style":109},[3870],{"type":58,"value":774},{"type":52,"tag":80,"props":3872,"children":3873},{"style":170},[3874],{"type":58,"value":779},{"type":52,"tag":80,"props":3876,"children":3877},{"style":103},[3878],{"type":58,"value":784},{"type":52,"tag":80,"props":3880,"children":3881},{"style":787},[3882],{"type":58,"value":790},{"type":52,"tag":80,"props":3884,"children":3885},{"style":103},[3886],{"type":58,"value":795},{"type":52,"tag":80,"props":3888,"children":3889},{"style":170},[3890],{"type":58,"value":800},{"type":52,"tag":80,"props":3892,"children":3893},{"style":103},[3894],{"type":58,"value":189},{"type":52,"tag":80,"props":3896,"children":3897},{"class":82,"line":250},[3898,3902,3906,3910,3914,3918,3922,3926,3930,3934,3939,3943,3947,3951],{"type":52,"tag":80,"props":3899,"children":3900},{"style":97},[3901],{"type":58,"value":960},{"type":52,"tag":80,"props":3903,"children":3904},{"style":109},[3905],{"type":58,"value":835},{"type":52,"tag":80,"props":3907,"children":3908},{"style":103},[3909],{"type":58,"value":292},{"type":52,"tag":80,"props":3911,"children":3912},{"style":295},[3913],{"type":58,"value":27},{"type":52,"tag":80,"props":3915,"children":3916},{"style":196},[3917],{"type":58,"value":774},{"type":52,"tag":80,"props":3919,"children":3920},{"style":103},[3921],{"type":58,"value":908},{"type":52,"tag":80,"props":3923,"children":3924},{"style":196},[3925],{"type":58,"value":822},{"type":52,"tag":80,"props":3927,"children":3928},{"style":103},[3929],{"type":58,"value":218},{"type":52,"tag":80,"props":3931,"children":3932},{"style":103},[3933],{"type":58,"value":137},{"type":52,"tag":80,"props":3935,"children":3936},{"style":140},[3937],{"type":58,"value":3938},"not-an-object",{"type":52,"tag":80,"props":3940,"children":3941},{"style":103},[3942],{"type":58,"value":148},{"type":52,"tag":80,"props":3944,"children":3945},{"style":103},[3946],{"type":58,"value":127},{"type":52,"tag":80,"props":3948,"children":3949},{"style":196},[3950],{"type":58,"value":795},{"type":52,"tag":80,"props":3952,"children":3953},{"style":103},[3954],{"type":58,"value":153},{"type":52,"tag":80,"props":3956,"children":3957},{"class":82,"line":259},[3958,3962,3966],{"type":52,"tag":80,"props":3959,"children":3960},{"style":103},[3961],{"type":58,"value":1062},{"type":52,"tag":80,"props":3963,"children":3964},{"style":109},[3965],{"type":58,"value":795},{"type":52,"tag":80,"props":3967,"children":3968},{"style":103},[3969],{"type":58,"value":153},{"type":52,"tag":1403,"props":3971,"children":3972},{},[3973],{"type":58,"value":3413},{"type":52,"tag":68,"props":3975,"children":3977},{"className":70,"code":3976,"language":72,"meta":73,"style":73},"import { initTRPC } from '@trpc\u002Fserver';\n\nconst t = initTRPC.create();\n\nasync function getUser() {\n  return { id: '1', name: 'Katt' };\n}\n\nconst middleware = t.middleware(async (opts) => {\n  return opts.next({ ctx: { user: await getUser() } });\n});\n",[3978],{"type":52,"tag":76,"props":3979,"children":3980},{"__ignoreMap":73},[3981,4020,4027,4062,4069,4093,4155,4162,4169,4224,4300],{"type":52,"tag":80,"props":3982,"children":3983},{"class":82,"line":83},[3984,3988,3992,3996,4000,4004,4008,4012,4016],{"type":52,"tag":80,"props":3985,"children":3986},{"style":97},[3987],{"type":58,"value":100},{"type":52,"tag":80,"props":3989,"children":3990},{"style":103},[3991],{"type":58,"value":106},{"type":52,"tag":80,"props":3993,"children":3994},{"style":109},[3995],{"type":58,"value":112},{"type":52,"tag":80,"props":3997,"children":3998},{"style":103},[3999],{"type":58,"value":127},{"type":52,"tag":80,"props":4001,"children":4002},{"style":97},[4003],{"type":58,"value":132},{"type":52,"tag":80,"props":4005,"children":4006},{"style":103},[4007],{"type":58,"value":137},{"type":52,"tag":80,"props":4009,"children":4010},{"style":140},[4011],{"type":58,"value":143},{"type":52,"tag":80,"props":4013,"children":4014},{"style":103},[4015],{"type":58,"value":148},{"type":52,"tag":80,"props":4017,"children":4018},{"style":103},[4019],{"type":58,"value":153},{"type":52,"tag":80,"props":4021,"children":4022},{"class":82,"line":93},[4023],{"type":52,"tag":80,"props":4024,"children":4025},{"emptyLinePlaceholder":160},[4026],{"type":58,"value":163},{"type":52,"tag":80,"props":4028,"children":4029},{"class":82,"line":156},[4030,4034,4038,4042,4046,4050,4054,4058],{"type":52,"tag":80,"props":4031,"children":4032},{"style":170},[4033],{"type":58,"value":273},{"type":52,"tag":80,"props":4035,"children":4036},{"style":109},[4037],{"type":58,"value":278},{"type":52,"tag":80,"props":4039,"children":4040},{"style":103},[4041],{"type":58,"value":283},{"type":52,"tag":80,"props":4043,"children":4044},{"style":109},[4045],{"type":58,"value":112},{"type":52,"tag":80,"props":4047,"children":4048},{"style":103},[4049],{"type":58,"value":292},{"type":52,"tag":80,"props":4051,"children":4052},{"style":295},[4053],{"type":58,"value":327},{"type":52,"tag":80,"props":4055,"children":4056},{"style":109},[4057],{"type":58,"value":318},{"type":52,"tag":80,"props":4059,"children":4060},{"style":103},[4061],{"type":58,"value":153},{"type":52,"tag":80,"props":4063,"children":4064},{"class":82,"line":166},[4065],{"type":52,"tag":80,"props":4066,"children":4067},{"emptyLinePlaceholder":160},[4068],{"type":58,"value":163},{"type":52,"tag":80,"props":4070,"children":4071},{"class":82,"line":192},[4072,4076,4080,4085,4089],{"type":52,"tag":80,"props":4073,"children":4074},{"style":170},[4075],{"type":58,"value":779},{"type":52,"tag":80,"props":4077,"children":4078},{"style":170},[4079],{"type":58,"value":2055},{"type":52,"tag":80,"props":4081,"children":4082},{"style":295},[4083],{"type":58,"value":4084}," getUser",{"type":52,"tag":80,"props":4086,"children":4087},{"style":103},[4088],{"type":58,"value":318},{"type":52,"tag":80,"props":4090,"children":4091},{"style":103},[4092],{"type":58,"value":189},{"type":52,"tag":80,"props":4094,"children":4095},{"class":82,"line":250},[4096,4100,4104,4108,4112,4116,4121,4125,4129,4134,4138,4142,4147,4151],{"type":52,"tag":80,"props":4097,"children":4098},{"style":97},[4099],{"type":58,"value":960},{"type":52,"tag":80,"props":4101,"children":4102},{"style":103},[4103],{"type":58,"value":106},{"type":52,"tag":80,"props":4105,"children":4106},{"style":196},[4107],{"type":58,"value":213},{"type":52,"tag":80,"props":4109,"children":4110},{"style":103},[4111],{"type":58,"value":218},{"type":52,"tag":80,"props":4113,"children":4114},{"style":103},[4115],{"type":58,"value":137},{"type":52,"tag":80,"props":4117,"children":4118},{"style":140},[4119],{"type":58,"value":4120},"1",{"type":52,"tag":80,"props":4122,"children":4123},{"style":103},[4124],{"type":58,"value":148},{"type":52,"tag":80,"props":4126,"children":4127},{"style":103},[4128],{"type":58,"value":117},{"type":52,"tag":80,"props":4130,"children":4131},{"style":196},[4132],{"type":58,"value":4133}," name",{"type":52,"tag":80,"props":4135,"children":4136},{"style":103},[4137],{"type":58,"value":218},{"type":52,"tag":80,"props":4139,"children":4140},{"style":103},[4141],{"type":58,"value":137},{"type":52,"tag":80,"props":4143,"children":4144},{"style":140},[4145],{"type":58,"value":4146},"Katt",{"type":52,"tag":80,"props":4148,"children":4149},{"style":103},[4150],{"type":58,"value":148},{"type":52,"tag":80,"props":4152,"children":4153},{"style":103},[4154],{"type":58,"value":247},{"type":52,"tag":80,"props":4156,"children":4157},{"class":82,"line":259},[4158],{"type":52,"tag":80,"props":4159,"children":4160},{"style":103},[4161],{"type":58,"value":2349},{"type":52,"tag":80,"props":4163,"children":4164},{"class":82,"line":267},[4165],{"type":52,"tag":80,"props":4166,"children":4167},{"emptyLinePlaceholder":160},[4168],{"type":58,"value":163},{"type":52,"tag":80,"props":4170,"children":4171},{"class":82,"line":338},[4172,4176,4180,4184,4188,4192,4196,4200,4204,4208,4212,4216,4220],{"type":52,"tag":80,"props":4173,"children":4174},{"style":170},[4175],{"type":58,"value":273},{"type":52,"tag":80,"props":4177,"children":4178},{"style":109},[4179],{"type":58,"value":439},{"type":52,"tag":80,"props":4181,"children":4182},{"style":103},[4183],{"type":58,"value":283},{"type":52,"tag":80,"props":4185,"children":4186},{"style":109},[4187],{"type":58,"value":371},{"type":52,"tag":80,"props":4189,"children":4190},{"style":103},[4191],{"type":58,"value":292},{"type":52,"tag":80,"props":4193,"children":4194},{"style":295},[4195],{"type":58,"value":19},{"type":52,"tag":80,"props":4197,"children":4198},{"style":109},[4199],{"type":58,"value":774},{"type":52,"tag":80,"props":4201,"children":4202},{"style":170},[4203],{"type":58,"value":779},{"type":52,"tag":80,"props":4205,"children":4206},{"style":103},[4207],{"type":58,"value":784},{"type":52,"tag":80,"props":4209,"children":4210},{"style":787},[4211],{"type":58,"value":790},{"type":52,"tag":80,"props":4213,"children":4214},{"style":103},[4215],{"type":58,"value":795},{"type":52,"tag":80,"props":4217,"children":4218},{"style":170},[4219],{"type":58,"value":800},{"type":52,"tag":80,"props":4221,"children":4222},{"style":103},[4223],{"type":58,"value":189},{"type":52,"tag":80,"props":4225,"children":4226},{"class":82,"line":346},[4227,4231,4235,4239,4243,4247,4251,4255,4259,4263,4268,4272,4276,4280,4284,4288,4292,4296],{"type":52,"tag":80,"props":4228,"children":4229},{"style":97},[4230],{"type":58,"value":960},{"type":52,"tag":80,"props":4232,"children":4233},{"style":109},[4234],{"type":58,"value":835},{"type":52,"tag":80,"props":4236,"children":4237},{"style":103},[4238],{"type":58,"value":292},{"type":52,"tag":80,"props":4240,"children":4241},{"style":295},[4242],{"type":58,"value":27},{"type":52,"tag":80,"props":4244,"children":4245},{"style":196},[4246],{"type":58,"value":774},{"type":52,"tag":80,"props":4248,"children":4249},{"style":103},[4250],{"type":58,"value":908},{"type":52,"tag":80,"props":4252,"children":4253},{"style":196},[4254],{"type":58,"value":822},{"type":52,"tag":80,"props":4256,"children":4257},{"style":103},[4258],{"type":58,"value":218},{"type":52,"tag":80,"props":4260,"children":4261},{"style":103},[4262],{"type":58,"value":106},{"type":52,"tag":80,"props":4264,"children":4265},{"style":196},[4266],{"type":58,"value":4267}," user",{"type":52,"tag":80,"props":4269,"children":4270},{"style":103},[4271],{"type":58,"value":218},{"type":52,"tag":80,"props":4273,"children":4274},{"style":97},[4275],{"type":58,"value":1657},{"type":52,"tag":80,"props":4277,"children":4278},{"style":295},[4279],{"type":58,"value":4084},{"type":52,"tag":80,"props":4281,"children":4282},{"style":196},[4283],{"type":58,"value":1717},{"type":52,"tag":80,"props":4285,"children":4286},{"style":103},[4287],{"type":58,"value":1062},{"type":52,"tag":80,"props":4289,"children":4290},{"style":103},[4291],{"type":58,"value":127},{"type":52,"tag":80,"props":4293,"children":4294},{"style":196},[4295],{"type":58,"value":795},{"type":52,"tag":80,"props":4297,"children":4298},{"style":103},[4299],{"type":58,"value":153},{"type":52,"tag":80,"props":4301,"children":4302},{"class":82,"line":387},[4303,4307,4311],{"type":52,"tag":80,"props":4304,"children":4305},{"style":103},[4306],{"type":58,"value":1062},{"type":52,"tag":80,"props":4308,"children":4309},{"style":109},[4310],{"type":58,"value":795},{"type":52,"tag":80,"props":4312,"children":4313},{"style":103},[4314],{"type":58,"value":153},{"type":52,"tag":1403,"props":4316,"children":4317},{},[4318,4320,4326],{"type":58,"value":4319},"Context extension in ",{"type":52,"tag":76,"props":4321,"children":4323},{"className":4322},[],[4324],{"type":58,"value":4325},"opts.next({ ctx })",{"type":58,"value":4327}," must be an object; passing non-object values or overwriting required keys breaks downstream procedures.",{"type":52,"tag":1403,"props":4329,"children":4330},{},[4331],{"type":58,"value":4332},"Source: www\u002Fdocs\u002Fserver\u002Fmiddlewares.md",{"type":52,"tag":61,"props":4334,"children":4336},{"id":4335},"see-also",[4337],{"type":58,"value":4338},"See Also",{"type":52,"tag":4340,"props":4341,"children":4342},"ul",{},[4343,4354,4365,4376],{"type":52,"tag":4344,"props":4345,"children":4346},"li",{},[4347,4352],{"type":52,"tag":76,"props":4348,"children":4350},{"className":4349},[],[4351],{"type":58,"value":42},{"type":58,"value":4353}," -- initTRPC, routers, procedures, context",{"type":52,"tag":4344,"props":4355,"children":4356},{},[4357,4363],{"type":52,"tag":76,"props":4358,"children":4360},{"className":4359},[],[4361],{"type":58,"value":4362},"validators",{"type":58,"value":4364}," -- input\u002Foutput validation with Zod",{"type":52,"tag":4344,"props":4366,"children":4367},{},[4368,4374],{"type":52,"tag":76,"props":4369,"children":4371},{"className":4370},[],[4372],{"type":58,"value":4373},"error-handling",{"type":58,"value":4375}," -- TRPCError codes used in auth middleware",{"type":52,"tag":4344,"props":4377,"children":4378},{},[4379,4385],{"type":52,"tag":76,"props":4380,"children":4382},{"className":4381},[],[4383],{"type":58,"value":4384},"auth",{"type":58,"value":4386}," -- full auth patterns combining middleware + client headers",{"type":52,"tag":4388,"props":4389,"children":4390},"style",{},[4391],{"type":58,"value":4392},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":4394,"total":1081},[4395,4410,4423,4436,4456,4469,4482],{"slug":4396,"name":4396,"fn":4397,"description":4398,"org":4399,"tags":4400,"stars":20,"repoUrl":21,"updatedAt":4409},"adapter-aws-lambda","deploy tRPC APIs on AWS Lambda","Deploy tRPC on AWS Lambda with awsLambdaRequestHandler() from @trpc\u002Fserver\u002Fadapters\u002Faws-lambda for API Gateway v1 (REST, APIGatewayProxyEvent) and v2 (HTTP, APIGatewayProxyEventV2), and Lambda Function URLs. Enable response streaming with awsLambdaStreamingRequestHandler() wrapped in awslambda.streamifyResponse(). CreateAWSLambdaContextOptions provides event and context for context creation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4401,4404,4407,4408],{"name":4402,"slug":4403,"type":15},"API Development","api-development",{"name":4405,"slug":4406,"type":15},"AWS","aws",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-07-18T05:47:05.451869",{"slug":4411,"name":4411,"fn":4412,"description":4413,"org":4414,"tags":4415,"stars":20,"repoUrl":21,"updatedAt":4422},"adapter-express","mount tRPC as Express middleware","Mount tRPC as Express middleware with createExpressMiddleware() from @trpc\u002Fserver\u002Fadapters\u002Fexpress. Access Express req\u002Fres in createContext via CreateExpressContextOptions. Mount at a path prefix like app.use('\u002Ftrpc', ...). Avoid global express.json() conflicting with tRPC body parsing for FormData.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4416,4417,4418,4421],{"name":4402,"slug":4403,"type":15},{"name":13,"slug":14,"type":15},{"name":4419,"slug":4420,"type":15},"Express","express",{"name":9,"slug":8,"type":15},"2026-07-18T05:46:53.274248",{"slug":4424,"name":4424,"fn":4425,"description":4426,"org":4427,"tags":4428,"stars":20,"repoUrl":21,"updatedAt":4435},"adapter-fastify","mount tRPC as a Fastify plugin","Mount tRPC as a Fastify plugin with fastifyTRPCPlugin from @trpc\u002Fserver\u002Fadapters\u002Ffastify. Configure prefix, trpcOptions (router, createContext, onError). Enable WebSocket subscriptions with useWSS and @fastify\u002Fwebsocket. Set routerOptions.maxParamLength for batch requests. Requires Fastify v5+. FastifyTRPCPluginOptions for type-safe onError. CreateFastifyContextOptions provides req, res.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4429,4430,4431,4434],{"name":4402,"slug":4403,"type":15},{"name":13,"slug":14,"type":15},{"name":4432,"slug":4433,"type":15},"Fastify","fastify",{"name":9,"slug":8,"type":15},"2026-07-18T05:46:53.746621",{"slug":4437,"name":4437,"fn":4438,"description":4439,"org":4440,"tags":4441,"stars":20,"repoUrl":21,"updatedAt":4455},"adapter-fetch","deploy tRPC on edge runtimes","Deploy tRPC on WinterCG-compliant edge runtimes with fetchRequestHandler() from @trpc\u002Fserver\u002Fadapters\u002Ffetch. Supports Cloudflare Workers, Deno Deploy, Vercel Edge Runtime, Astro, Remix, SolidStart. FetchCreateContextFnOptions provides req (Request) and resHeaders (Headers) for context creation. The endpoint option must match the URL path prefix where the handler is mounted.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4442,4445,4448,4451,4452],{"name":4443,"slug":4444,"type":15},"Cloudflare","cloudflare",{"name":4446,"slug":4447,"type":15},"Deployment","deployment",{"name":4449,"slug":4450,"type":15},"Edge","edge",{"name":9,"slug":8,"type":15},{"name":4453,"slug":4454,"type":15},"Vercel","vercel","2026-07-18T05:46:50.548228",{"slug":4457,"name":4457,"fn":4458,"description":4459,"org":4460,"tags":4461,"stars":20,"repoUrl":21,"updatedAt":4468},"adapter-standalone","mount tRPC on Node.js servers","Mount tRPC on Node.js built-in HTTP server with createHTTPServer() from @trpc\u002Fserver\u002Fadapters\u002Fstandalone, createHTTPHandler() for custom http.createServer, createHTTP2Handler() for HTTP\u002F2 with TLS. Configure basePath to slice URL prefix, CORS via the cors npm package passed as middleware option. CreateHTTPContextOptions provides req and res for context creation.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4462,4463,4464,4467],{"name":4402,"slug":4403,"type":15},{"name":13,"slug":14,"type":15},{"name":4465,"slug":4466,"type":15},"Node.js","node-js",{"name":9,"slug":8,"type":15},"2026-07-18T05:46:58.093869",{"slug":4384,"name":4384,"fn":4470,"description":4471,"org":4472,"tags":4473,"stars":20,"repoUrl":21,"updatedAt":4481},"implement authentication in tRPC applications","Implement JWT\u002Fcookie authentication and authorization in tRPC using createContext for user extraction, t.middleware with opts.next({ ctx }) for context narrowing to non-null user, protectedProcedure base pattern, client-side Authorization headers via httpBatchLink headers(), WebSocket connectionParams, and SSE auth via cookies or EventSource polyfill custom headers.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4474,4476,4479,4480],{"name":4475,"slug":4384,"type":15},"Auth",{"name":4477,"slug":4478,"type":15},"Authentication","authentication",{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},"2026-07-18T05:46:45.347628",{"slug":4483,"name":4483,"fn":4484,"description":4485,"org":4486,"tags":4487,"stars":20,"repoUrl":21,"updatedAt":4495},"caching","configure HTTP caching for tRPC queries","Set HTTP cache headers on tRPC query responses via responseMeta callback for CDN and browser caching. Configure Cache-Control, s-maxage, stale-while-revalidate. Handle caching with batching and authenticated requests. Avoid caching mutations, errors, and authenticated responses.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4488,4489,4491,4494],{"name":13,"slug":14,"type":15},{"name":4490,"slug":4483,"type":15},"Caching",{"name":4492,"slug":4493,"type":15},"Performance","performance",{"name":9,"slug":8,"type":15},"2026-07-18T05:46:45.86443",{"items":4497,"total":1081},[4498,4505,4512,4519,4527,4534,4541,4548,4560,4573,4583,4589],{"slug":4396,"name":4396,"fn":4397,"description":4398,"org":4499,"tags":4500,"stars":20,"repoUrl":21,"updatedAt":4409},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4501,4502,4503,4504],{"name":4402,"slug":4403,"type":15},{"name":4405,"slug":4406,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":4411,"name":4411,"fn":4412,"description":4413,"org":4506,"tags":4507,"stars":20,"repoUrl":21,"updatedAt":4422},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4508,4509,4510,4511],{"name":4402,"slug":4403,"type":15},{"name":13,"slug":14,"type":15},{"name":4419,"slug":4420,"type":15},{"name":9,"slug":8,"type":15},{"slug":4424,"name":4424,"fn":4425,"description":4426,"org":4513,"tags":4514,"stars":20,"repoUrl":21,"updatedAt":4435},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4515,4516,4517,4518],{"name":4402,"slug":4403,"type":15},{"name":13,"slug":14,"type":15},{"name":4432,"slug":4433,"type":15},{"name":9,"slug":8,"type":15},{"slug":4437,"name":4437,"fn":4438,"description":4439,"org":4520,"tags":4521,"stars":20,"repoUrl":21,"updatedAt":4455},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4522,4523,4524,4525,4526],{"name":4443,"slug":4444,"type":15},{"name":4446,"slug":4447,"type":15},{"name":4449,"slug":4450,"type":15},{"name":9,"slug":8,"type":15},{"name":4453,"slug":4454,"type":15},{"slug":4457,"name":4457,"fn":4458,"description":4459,"org":4528,"tags":4529,"stars":20,"repoUrl":21,"updatedAt":4468},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4530,4531,4532,4533],{"name":4402,"slug":4403,"type":15},{"name":13,"slug":14,"type":15},{"name":4465,"slug":4466,"type":15},{"name":9,"slug":8,"type":15},{"slug":4384,"name":4384,"fn":4470,"description":4471,"org":4535,"tags":4536,"stars":20,"repoUrl":21,"updatedAt":4481},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4537,4538,4539,4540],{"name":4475,"slug":4384,"type":15},{"name":4477,"slug":4478,"type":15},{"name":13,"slug":14,"type":15},{"name":9,"slug":8,"type":15},{"slug":4483,"name":4483,"fn":4484,"description":4485,"org":4542,"tags":4543,"stars":20,"repoUrl":21,"updatedAt":4495},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4544,4545,4546,4547],{"name":13,"slug":14,"type":15},{"name":4490,"slug":4483,"type":15},{"name":4492,"slug":4493,"type":15},{"name":9,"slug":8,"type":15},{"slug":4549,"name":4549,"fn":4550,"description":4551,"org":4552,"tags":4553,"stars":20,"repoUrl":21,"updatedAt":4559},"client-setup","set up vanilla tRPC clients","Create a vanilla tRPC client with createTRPCClient\u003CAppRouter>(), configure link chain with httpBatchLink\u002FhttpLink, dynamic headers for auth, transformer on links (not client constructor). Infer types with inferRouterInputs and inferRouterOutputs. AbortController signal support. TRPCClientError typing.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4554,4555,4558],{"name":4402,"slug":4403,"type":15},{"name":4556,"slug":4557,"type":15},"Frontend","frontend",{"name":9,"slug":8,"type":15},"2026-07-18T05:48:11.437946",{"slug":4373,"name":4373,"fn":4561,"description":4562,"org":4563,"tags":4564,"stars":20,"repoUrl":21,"updatedAt":4572},"implement typed error handling in tRPC","Throw typed errors with TRPCError and error codes (NOT_FOUND, UNAUTHORIZED, BAD_REQUEST, INTERNAL_SERVER_ERROR), configure errorFormatter for client-side Zod error display, handle errors globally with onError callback, map tRPC errors to HTTP status codes with getHTTPStatusCodeFromError().\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4565,4566,4569,4570],{"name":13,"slug":14,"type":15},{"name":4567,"slug":4568,"type":15},"Debugging","debugging",{"name":9,"slug":8,"type":15},{"name":4571,"slug":31,"type":15},"TypeScript","2026-07-18T05:46:52.798151",{"slug":4574,"name":4574,"fn":4575,"description":4576,"org":4577,"tags":4578,"stars":20,"repoUrl":21,"updatedAt":4582},"links","configure tRPC client link chains","Configure the tRPC client link chain: httpLink, httpBatchLink, httpBatchStreamLink, splitLink, loggerLink, wsLink, createWSClient, httpSubscriptionLink, unstable_localLink, retryLink. Choose the right terminating link. Route subscriptions via splitLink. Build custom links for SOA routing. Link options: url, headers, transformer, maxURLLength, maxItems, connectionParams, EventSource ponyfill.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4579,4580,4581],{"name":4402,"slug":4403,"type":15},{"name":4556,"slug":4557,"type":15},{"name":9,"slug":8,"type":15},"2026-07-18T05:47:06.847309",{"slug":4,"name":4,"fn":5,"description":6,"org":4584,"tags":4585,"stars":20,"repoUrl":21,"updatedAt":22},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4586,4587,4588],{"name":13,"slug":14,"type":15},{"name":18,"slug":19,"type":15},{"name":9,"slug":8,"type":15},{"slug":4590,"name":4590,"fn":4591,"description":4592,"org":4593,"tags":4594,"stars":20,"repoUrl":21,"updatedAt":4602},"nextjs-app-router","implement tRPC in Next.js App Router","Full end-to-end tRPC setup for Next.js App Router. Covers route handler with fetchRequestHandler (GET + POST exports), TRPCProvider with QueryClientProvider, createTRPCOptionsProxy for RSC prefetching, HydrateClient\u002FHydrationBoundary for hydration, useSuspenseQuery for Suspense, and server-side callers.\n",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[4595,4596,4597,4600,4601],{"name":13,"slug":14,"type":15},{"name":4556,"slug":4557,"type":15},{"name":4598,"slug":4599,"type":15},"Next.js","next-js",{"name":9,"slug":8,"type":15},{"name":4571,"slug":31,"type":15},"2026-07-18T05:47:10.468453"]