npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

create-line-bot

v0.2.1

Published

Scaffold a LINE bot that survives production on Next.js + Supabase + Vercel, wired to line-bot-ops-mcp so Claude, Cursor or any AI agent can operate it.

Readme

create-line-bot

Scaffold a LINE bot that survives production.

npx create-line-bot my-bot

Next.js 16 (App Router) + Supabase + Vercel. No @line/bot-sdk, no heavy imports in the webhook path — because the webhook has five seconds and cold starts eat them.

Why this exists

Starting a LINE bot is easy. Keeping one alive is not. Every LINE bot I have shipped hit the same six problems, and none of them are in the quickstart:

| Problem | What this template does | | --- | --- | | LINE times out the webhook after 5 seconds, and a cold start with a fat SDK import eats most of it | Webhook verifies, writes one row, returns 200; work moves to a separate worker route via after() | | LINE retries webhooks, and serverless functions can run twice | Four independent idempotency layers — event id, reply token, job claim, business dedupe key | | A reply token is single-use; spending it twice throws | Conditional update claims the token before it is spent | | Rich Menu uploads are not idempotent — run the script twice, get two menus | Name-based uploader that removes the previous menu first | | LIFF ID tokens are trusted client-side far too often | Token is verified against LINE's API server-side on every link | | .env.local is not read by Vercel | Deploy section spells out vercel env add per variable |

Operate it from Claude, Cursor or any AI agent

Every generated project comes wired to line-bot-ops-mcp, an MCP server that reads its own queue and database. Open the project in Claude Code and ask:

"Why did the bot stop replying?" → line_queue_health, line_failed_jobs, line_retry_job "How many followers did we gain yesterday, and how much push quota is left?" "Switch user U123… to the seller menu."

Generic LINE MCP servers can send messages. This one also knows your webhook queue, so it can tell you why a message was never answered. Broadcast is off unless you opt in.

Already have a bot? Run the same server on its own: npx -y line-bot-ops-mcp.

What you get

src/app/api/line/webhook/route.ts   signature verify + fast ack
src/app/api/line/worker/route.ts    claim jobs, reply, retry safely
src/app/api/liff/link/route.ts      server-side ID token verification
src/app/liff/page.tsx               LIFF init + login
src/lib/line.ts                     signature, reply, push, verifyIdToken (fetch only)
src/lib/jobs.ts                     enqueue, claim, reply-token guard
scripts/rich-menu.ts                idempotent Rich Menu uploader
.mcp.json                           Claude Code loads line-bot-ops-mcp automatically
supabase/migrations/0001_init.sql   line_jobs, line_users, claim_line_jobs()

Setup

The generated project ships its own README with the full table of environment variables, the message-flow diagram, and the deploy steps. Short version:

npx create-line-bot my-bot
cd my-bot
npm install
cp .env.example .env.local     # LINE + Supabase credentials
npm run db:push
npm run dev

Then set the channel webhook to https://<origin>/api/line/webhook.

The long-form versions

Each shortcut above started as a written-up incident:

Status

v0.2 — bot + LIFF + Supabase on Vercel, wired to an MCP server to run it from an AI agent. Issues and PRs welcome, especially from anyone running LINE bots at scale in Thailand or Japan.

Sponsor

LINE changes its Messaging API several times a year, and a scaffolder is only useful if what it generates still works on the day you run it. Sponsorship pays for keeping it that way: tracking API changes, re-testing the template against new Next.js and Supabase releases, and answering issues.

If your team runs a bot built from this, sponsor on GitHub.

License

MIT