/major:using-webhooksfrom major
Explains how to enable webhook access on deployed Major apps and implement webhook endpoints under /api/webhook/. Covers token-based and unauthenticated options, verification, and route setup.
Ships in major. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Major apps are protected by an authentication gateway by default. Enabling Webhook Access allows unauthenticated HTTP traffic to reach routes matching /api/webhook/* on deployed apps only. This is required for receiving callbacks from external services like Stripe, GitHub, Twilio, etc.
Important: Webhook access simply allows traffic through — it does NOT perform any authentication or verification. If the webhook provider supports authentication (e.g., Stripe signature verification, GitHub webhook secrets, Twilio request validation), the application MUST implement its own verification at the application layer.
x-major-jwt: <token> or as ?major_token=<token>. The token works only on the app it was created for, on both the deployed app and the preview.Major dashboard > open the app > Settings tab > Webhook Access > Webhook tokens > Create. Only app admins can create tokens. The agent never creates or sees a token. Tell the user to create one and to paste the URL (https://<app-host>/api/webhook/<your-route>?major_token=<token>) into the sender.
The request arrives as the token's creator in x-major-user-id. The app must not log full request URLs, because the query can contain major_token.
Run major app info --json from the app workspace to check the current app status, including webhooksEnabled. In a hosted sandbox, run it through mcp__plugin_major_major__sandbox_bash.
If webhooks are not enabled, instruct the user to enable them from the Major dashboard → App Settings → Webhook Access toggle.
Note: If the app is already public (isPublic: true), webhook access is not needed — all unauthenticated traffic is already allowed.
Create your webhook routes under the /api/webhook/ path. Only routes matching this pattern will bypass authentication when webhook access is enabled. The backend's app already has .basePath("/api"), so a route at /webhook/stripe serves /api/webhook/stripe.
// backend/src/routes/webhooks.ts
import { createRoute, z, type OpenAPIHono } from "@hono/zod-openapi";
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
const webhookSecret = process.env.STRIPE_WEBHOOK_SECRET!;
// No request body schema: the signature check needs the raw body, so nothing may parse it first.
const stripeWebhookRoute = createRoute({
method: "post",
path: "/webhook/stripe",
responses: {
200: {
description: "The event was verified and handled",
content: { "application/json": { schema: z.object({ received: z.boolean() }) } },
},
400: {
description: "The signature did not verify",
content: { "application/json": { schema: z.object({ error: z.string() }) } },
},
},
});
export function registerWebhookRoutes(app: OpenAPIHono) {
app.openapi(stripeWebhookRoute, async (c) => {
const body = await c.req.text();
const signature = c.req.header("stripe-signature") ?? "";
// CRITICAL: Verify the webhook signature at the application layer
let event: Stripe.Event;
try {
event = stripe.webhooks.constructEvent(body, signature, webhookSecret);
} catch {
return c.json({ error: "Invalid signature" }, 400);
}
// Handle the verified event
switch (event.type) {
case "checkout.session.completed":
// Process the event
break;
}
return c.json({ received: true }, 200);
});
}
Register it in backend/src/app.ts (registerWebhookRoutes(app);) and install stripe in the backend (pnpm --filter ./backend add stripe). In an older Next.js app, the same handler goes in app/api/webhook/stripe/route.ts as export async function POST(request: Request), reading the body with await request.text().
/api/webhook/* routes are bypassed. All other routes still require authenticationSTRIPE_WEBHOOK_SECRET, GITHUB_WEBHOOK_SECRET) as environment variables in the Major dashboardWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
13 skills in this plugin
/agent-builderCreate and configure a Major agent — a versioned two-file bundle (agent.jsonc + prompt.md) edited on a sandbox — what each field means, how to research connectors and applications before writing the prompt, and the edit/validate/save/publish lifecycle./app-builderCreate and edit Major apps — full-stack apps with a Vite + React frontend, a Hono backend under /api, and a live preview — how to create or mount an app sandbox and edit through the workspace tools./app-performanceUse this skill when the user says a Major app is slow, laggy, sluggish, takes a long time to load, hangs, spins, or times out, or asks to speed up, optimize, tune, cache, or scale an app, page, query, or API route. Covers measuring where the time goes (resource-call timings, CPU and memory usage), fixing slow and chatty queries, choosing a cache and agreeing its staleness with the user, and resizing the app's CPU and memory. Do not use it for failures that are not about speed — that is debug-issue./debug-issueUse this skill when the user asks to debug, investigate, inspect for bugs, fix an issue, or says the app is broken, failing, wrong, blank, errored, or not working. Also use it when you observe a concrete existing failure yourself, including runtime errors, failed tool/API calls, browser console errors, app errors, app logs, actual visual regressions, failing lint/tests/builds, deployment issues, bad data, auth issues, or flaky behavior. Do not use this skill for forward-looking UX polish requests like "make the UX nicer" or "improve the design" unless the user identifies a specific existing broken behavior or regression to verify./file-builderCreate and edit Major Files — static pages (HTML plus CSS, JS, JSON, images, fonts, markdown) with their data written in, made in minutes with no backend or deploy — and the sandbox-based edit/validate/save/publish lifecycle. Use for anything static the user will read or share with colleagues, such as a report, briefing, explainer, or one-off chart, or to change an existing File. A page that needs fresh data, saves input, or runs compute is an app instead./new-projectUse this skill when the user is building a brand new app for the first time. Guides connector setup, data layer understanding, and initial planning.npx claudepluginhub major-technology/cli --plugin majorOther plugins' skills for the same job