T
TanStack9mo ago
robust-apricot

Has anyone been able to get Inngest working with TanStack Start?

There is a nitro export in Inngest
import { serve } from "inngest/nitro";
import { serve } from "inngest/nitro";
But I am not sure how to configure it.
1 Reply
robust-apricot
robust-apricotOP8mo ago
Their docs are here https://www.inngest.com/docs/getting-started/nodejs-quick-start Here are more detailed instructions for several frameworks. https://www.inngest.com/docs/learn/serving-inngest-functions#framework-nitro More details https://github.com/inngest/inngest-js/blob/main/packages/inngest/src/test/functions/handler.ts This works on my local machine:
import { createAPIFileRoute } from "@tanstack/start/api";
import { serve } from "inngest/edge";
import { inngest } from "../../../inngest/client2";
import { helloWorld, helloWorld2000 } from "../../../inngest/functions2";

const handler = serve({
client: inngest,
functions: [helloWorld, helloWorld2000],
servePath: "/api/inngest",
streaming: "force",
});

export const APIRoute = createAPIFileRoute("/api/inngest")({
GET: ({ request }) => {
return handler(request);
},

POST: ({ request }) => {
return handler(request);
},

PUT: ({ request }) => {
return handler(request);
},
});
import { createAPIFileRoute } from "@tanstack/start/api";
import { serve } from "inngest/edge";
import { inngest } from "../../../inngest/client2";
import { helloWorld, helloWorld2000 } from "../../../inngest/functions2";

const handler = serve({
client: inngest,
functions: [helloWorld, helloWorld2000],
servePath: "/api/inngest",
streaming: "force",
});

export const APIRoute = createAPIFileRoute("/api/inngest")({
GET: ({ request }) => {
return handler(request);
},

POST: ({ request }) => {
return handler(request);
},

PUT: ({ request }) => {
return handler(request);
},
});
The local Inngest dashboard won't auto detect it, but you can add the app manually to the dashboard. Howver, it does not work at all when deployed to Vercel. See also https://discord.com/channels/842170679536517141/1324205318690832446 Update: Inngest has a solution for TanStack Start, see the link to the Inngest Discord server above.

Did you find this page helpful?