Quickstart
Prerequisites
Section titled “Prerequisites”- Node.js 20+
- pnpm
- A Slack app with signing secret + bot token
- Redis URL
- A Vercel account
Create a new app
Section titled “Create a new app”npx @sentry/junior init my-botcd my-botpnpm installInstall Junior with a plugin package
Section titled “Install Junior with a plugin package”pnpm add @sentry/junior @sentry/junior-githubThis keeps the model extension-first from the start: runtime + at least one integration package.
Wire routes
Section titled “Wire routes”export { GET, POST } from "@sentry/junior/handler";export const runtime = "nodejs";export { POST } from "@sentry/junior/handlers/queue-callback";export const runtime = "nodejs";Enable Next.js runtime config
Section titled “Enable Next.js runtime config”import { withJunior } from "@sentry/junior/config";
export default withJunior({ pluginPackages: ["@sentry/junior-github"]});export { register, onRequestError } from "@sentry/junior/instrumentation";If your app has no root layout yet:
export { default } from "@sentry/junior/app/layout";Set required env vars
Section titled “Set required env vars”SLACK_SIGNING_SECRET=...SLACK_BOT_TOKEN=...REDIS_URL=...Run locally
Section titled “Run locally”pnpm devVerify locally
Section titled “Verify locally”GET http://localhost:3000/api/healthreturns JSON withstatus: "ok".- A Slack mention triggers a threaded response.
Deploy to Vercel
Section titled “Deploy to Vercel”Link the project
Section titled “Link the project”pnpm dlx vercel@latest loginpnpm dlx vercel@latest linkAdd queue trigger
Section titled “Add queue trigger”{ "functions": { "app/api/queue/callback/route.ts": { "experimentalTriggers": [ { "type": "queue/v2beta", "topic": "junior-thread-message" } ] } }}If your project uses JavaScript route files (for example from junior init), use
app/api/queue/callback/route.js instead.
Configure build command
Section titled “Configure build command”Set the Vercel build command to run snapshot warmup after app build.
{ "scripts": { "build": "next build && junior snapshot create" }}If you prefer postbuild, ensure Vercel runs pnpm build as the build command.
Configure production environment
Section titled “Configure production environment”Required:
SLACK_SIGNING_SECRETSLACK_BOT_TOKEN(orSLACK_BOT_USER_TOKEN)REDIS_URL
Also required for build-time snapshot warmup:
- Vercel OIDC enabled so
VERCEL_OIDC_TOKENis available during build
Recommended:
JUNIOR_BOT_NAMEAI_MODELAI_FAST_MODEL
Optional:
JUNIOR_BASE_URLAI_GATEWAY_API_KEY
Configure Slack request URL
Section titled “Configure Slack request URL”Set Event Subscriptions and Interactivity URLs to:
https://<your-domain>/api/webhooks/slackVerify in production
Section titled “Verify in production”GET https://<your-domain>/api/healthsucceeds.- A Slack mention produces a thread reply.
- Queue callback logs show successful processing.
Common failures
Section titled “Common failures”401or signature failures: verifySLACK_SIGNING_SECRET.- No thread processing: confirm both catch-all and queue callback routes exist.
- No bot post: verify bot token scopes and Slack app installation.
- Slack timeouts in production: check
vercel.jsonqueue trigger and callback route path. - OAuth callback issues for plugins: set
JUNIOR_BASE_URLto production URL. - Snapshot warmup build failures: verify
REDIS_URLis available to builds and OIDC is enabled forVERCEL_OIDC_TOKEN.
Next step
Section titled “Next step”Now that runtime wiring is done, focus on extension: