HTTP Handler - minesa-org/mini-interaction GitHub Wiki

For a Vercel project, create api/interactions.ts and expose the handler returned by createVercelHandler() or createFetchHandler().

// api/interactions.ts
import { MiniInteraction } from "mini-interaction";

const mini = new MiniInteraction({
	applicationId: process.env.DISCORD_APPLICATION_ID!,
	publicKey: process.env.DISCORD_APP_PUBLIC_KEY!,
	// Optional: set a custom commands directory
	// commandsDirectory: "src/commands",
});

export default mini.createVercelHandler();

That is enough for Discord to ping your endpoint and dispatch incoming commands to the right handler.