How to add Prisma Client extensions to create-t3-app?
Hi! I want to create a new prisma extension that is available inside my innerTrpcContext. (so I can acces it next to my context, and normal prisma client).
I tried to just add it to innerTrpcContext like in this picture. I need to kind of create inside the context because I want to access logged user values to attach to the prisma extension.
I tried like this, but it didn't work when I tried calling safeWsPrisma. (it was undefined at runtime) I guess it's because I need to do something with
globalThis
at the export file level, but I'm unsure how to do it. Does anyone have a way to add extensions to create-t3-app?
1 Reply
I know people often need code in text format, so here we go: