NEO
NEO
TtRPC
Created by kstulgys on 10/20/2023 in #❓-help
Why webhooks does not work with TRPC?
import { buffer } from "micro";

const stripeWebhook = publicProcedure
.meta({
openapi: {
method: "POST",
path: "/stripe-webhook",
},
})
.input(z.void())
.output(
z.object({
status: z.string(),
})
)
.mutation(async ({ ctx }) => {
const buf = await buffer(ctx.req);
const request = buf.toString("utf8");
});
import { buffer } from "micro";

const stripeWebhook = publicProcedure
.meta({
openapi: {
method: "POST",
path: "/stripe-webhook",
},
})
.input(z.void())
.output(
z.object({
status: z.string(),
})
)
.mutation(async ({ ctx }) => {
const buf = await buffer(ctx.req);
const request = buf.toString("utf8");
});
this is how I handle my stripe webhook, the body is somewhere is request you'll have to figure it out
10 replies
TtRPC
Created by freddie on 7/15/2023 in #❓-help
adapter for hono or hattip?
If you're using bun. Elysia has an unofficial adapter https://elysiajs.com/plugins/trpc.html
4 replies
TtRPC
Created by frankind.eth | Franco Aguzzi on 5/31/2023 in #❓-help
How to retrieve and receive Bigint data to/from TRPC procedure
The workaround is to extend BigInt by modifying the prototype Create a bigintPatch.ts file and paste this code
//@ts-expect-error
BigInt.prototype.toJSON = function () {
const int = Number.parseInt(this.toString())
return int ?? this.toString()
}
//@ts-expect-error
BigInt.prototype.toJSON = function () {
const int = Number.parseInt(this.toString())
return int ?? this.toString()
}
then import it like import "bigintPatch.ts" on the page where you’re calling the query/mutation
11 replies
TtRPC
Created by NEO on 5/21/2023 in #❓-help
Cannot access 't' before initialization
16 replies
TtRPC
Created by NEO on 5/21/2023 in #❓-help
Cannot access 't' before initialization
Was trying your approach to middleware doesn't seem like it would work for chaining multiple middlewares
16 replies
TtRPC
Created by NEO on 5/21/2023 in #❓-help
Cannot access 't' before initialization
16 replies
TtRPC
Created by NEO on 5/21/2023 in #❓-help
Cannot access 't' before initialization
Interesting, I might try this, wasted so much time on this already haha
16 replies
TtRPC
Created by NEO on 5/21/2023 in #❓-help
Cannot access 't' before initialization
Turns out I can't define middlewares in a separate file, moving them under the api.ts solved the issue for me
16 replies
TtRPC
Created by rostero on 5/19/2023 in #❓-help
Stack for expo?
Try https://hop.io/ for PaaS, tried it recently had a great experience
2 replies
TtRPC
Created by backbone on 4/30/2023 in #❓-help
how to integrate with Redis (ioredis)
4 replies
TtRPC
Created by Eternal Mori on 4/21/2023 in #❓-help
How can I make a direct fetch on a router endpoint from TRPC in NextJS on client?
3 replies
TtRPC
Created by NEO on 4/7/2023 in #❓-help
tRPC standalone server in monorepo
They had a new update recently which added support for workspaces so I thought I'd give it a shot, anyway thanks for looking.
13 replies
TtRPC
Created by NEO on 4/7/2023 in #❓-help
tRPC standalone server in monorepo
Turns out it was the package manager bun, installing the deps with pnpm worked fine
13 replies
TtRPC
Created by NEO on 4/7/2023 in #❓-help
tRPC standalone server in monorepo
Yes, as I said before I’m using t3 stack monorepo template and the server and client have the same version of trpc
13 replies
TtRPC
Created by NEO on 4/7/2023 in #❓-help
tRPC standalone server in monorepo
That’s what I get at this line
export const trpc = createTRPCReact<AppRouter>()
export const trpc = createTRPCReact<AppRouter>()
13 replies
TtRPC
Created by NEO on 4/7/2023 in #❓-help
tRPC standalone server in monorepo
Check the third file in gist for the error
13 replies