Skip to content

About

Chat SDK adapter for Line

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

Chat SDK LINE adapter

LINE Messaging API adapter for Chat SDK. It receives webhook events from your LINE bot and sends replies, mentions, native emoji, quotes, Flex Messages, stickers, images, videos, audio, locations, and batch messages back. It also reports LINE's lifecycle events, from a new follower to a member leaving a group.

Install the package

The adapter needs chat 4.17.0 or a later 4.x release:

npm install chat-adapter-line chat @chat-adapter/state-memory

Set up a bot

Create a Chat instance with the LINE adapter and register handlers:

import { createMemoryState } from "@chat-adapter/state-memory";
import { Chat } from "chat";
import { createLineAdapter } from "chat-adapter-line";

const bot = new Chat({
  userName: "mybot",
  adapters: {
    line: createLineAdapter(),
  },
  state: createMemoryState(),
});

bot.onNewMention(async (thread) => {
  await thread.subscribe();
  await thread.post("Hello! I'm listening to this thread.");
});

bot.onSubscribedMessage(async (thread, message) => {
  await thread.post(`You said: ${message.text}`);
});

The memory state is for development. It loses its data on restart, and its locks are not shared across instances. Production needs a persistent adapter such as @chat-adapter/state-redis.

The factory reads credentials from environment variables by default:

Environment variable Required Description
LINE_CHANNEL_ACCESS_TOKEN Yes The access token for the LINE channel.
LINE_CHANNEL_SECRET Yes The secret for the LINE channel.

You can also pass them as options to the factory:

const adapter = createLineAdapter({
  channelAccessToken: "your_channel_access_token",
  channelSecret: "your_channel_secret",
});

Connect the webhook

Expose the adapter's webhook from a route. This Next.js App Router file is app/api/webhooks/line/route.ts, and bot is the Chat instance from the setup above:

import { after } from "next/server";

import { bot } from "@/lib/bot";

export const POST = (request: Request) =>
  bot.webhooks.line(request, { waitUntil: (task) => after(() => task) });

waitUntil keeps a serverless function alive until your handlers finish.

Then connect LINE to the route:

  1. In the LINE Developers Console, open the channel's "Messaging API" tab.
  2. Set the Webhook URL to the route's public URL.
  3. Turn on "Use webhook".
  4. Press "Verify".
  5. In the LINE Official Account Manager, turn off auto-reply messages so LINE does not answer on the bot's behalf.

Reply-token-first sending

LINE does not bill Reply API calls, but each Push API call counts against the channel's monthly message quota. That quota varies by plan and by country or region. When the quota is used up, LINE answers a push with 429 and the adapter throws AdapterRateLimitError. Its message ends with LINE's reason, You have reached your monthly limit., and error.cause is the LINE SDK's HTTPFetchError.

When your bot answers an inbound message, the adapter sends that first reply through the Reply API. Later sends use the Push API, because a reply token works once and expires within a minute. You don't need to change any adapter code.

Streaming replies

LINE cannot edit a sent message, so thread.post() with a text stream, such as an AI SDK textStream, cannot grow a message in place. The adapter collects the whole stream and renders it like a Markdown postable. It then sends as many text messages as LINE's 5000-character limit needs, five to a request. The first request goes through the free Reply API when a reply token is fresh. The adapter drops nothing, however long the reply. If the stream fails partway, the adapter sends the text it has collected so far and then rethrows the stream's error, so the user keeps the partial reply and your handler still sees the failure. In a 1:1 chat, LINE's loading animation shows while the adapter collects the stream, renewed every 15 seconds until the stream ends. Call thread.startTyping() as well when your handler does other work before it starts streaming.

Bursts of messages

A user who sends several photos at once produces several message events at the same moment. The Chat SDK's default is concurrency: "drop", so the events after the first are discarded while a handler runs. The SDK offers other strategies. See the Chat SDK concurrency docs.

With queue, debounce, or burst, the SDK stores a waiting message in your state adapter. On chat 4.27.0 or later its attachments keep fetchData(), so a photo that waited still downloads. A state adapter that stores JSON, such as Redis or Postgres, hands the message back as a plain Message, so message instanceof LineMessage is false for it. Parse its raw event again to read the LINE fields:

import type { LineMessageEvent } from "chat-adapter-line";

bot.onSubscribedMessage(async (thread, message) => {
  const lineMessage = bot
    .getAdapter("line")
    .parseMessage(message.raw as LineMessageEvent);
  console.log(lineMessage.media?.kind);
});

Direct messages and mentions

A LINE thread whose source is a single user is a direct message, so bot.onDirectMessage() fires for 1:1 chats. That handler needs chat 4.20.0 or later. In groups and rooms, LINE delivers native mentions as structured data. The adapter parses them onto the message and sets message.isMention when someone mentions the bot, so onNewMention() works without any @name text matching. Each LINE conversation is its own Chat SDK channel, so thread.channel.post() sends to the same 1:1 chat, group, or room, and thread.channel.setState() keeps state for that conversation alone.

Inbound text messages are LineMessage instances. Each entry in message.mentions has a type of user or all, plus index and length for its position in the text. User mentions also carry userId and isSelf when the mentioned user has shared their profile with the channel:

import { LineMessage } from "chat-adapter-line";

bot.onSubscribedMessage(async (thread, message) => {
  if (!(message instanceof LineMessage)) {
    return;
  }
  for (const mention of message.mentions) {
    console.log(mention.type, mention.userId, mention.isSelf);
  }
});

Typing indicator

thread.startTyping() shows LINE's loading animation in a 1:1 chat for up to 20 seconds, or until the bot's next message arrives. LINE has no typing indicator in groups or rooms, so the call does nothing there. The call returns without waiting for LINE, so your handler starts its real work at once. The bot's next message waits for the request, so the animation never reappears after the reply. A failed request is logged at debug level and never throws. While thread.post() collects a stream, the adapter renews the animation until the stream ends.

What LINE cannot do

LINE has no API to edit or delete a sent message or to add a reaction. editMessage(), deleteMessage(), addReaction(), and removeReaction() reject with the Chat SDK's NotImplementedError, so check for it with instanceof where you want to skip these calls on LINE.

LINE has no message history API either. The adapter has the Chat SDK keep history in your state adapter instead, starting when the bot receives its first message. thread.messages and thread.refresh() read from it, and by default the SDK keeps the newest 100 messages per thread for seven days. This needs chat 4.20.0 or later. On earlier versions both return no messages.

In groups and rooms, members who have not shared their profile with the channel all appear as the author "unknown", so they share one author in that history.

Posting LINE-native messages

The Chat SDK's PostableMessage type does not know about LINE's extra fields, so wrap LINE-native postables in linePostable() when calling thread.post(). The helper only narrows the static type. The adapter accepts these shapes at runtime either way.

LINE caps a text message at 5000 characters, counted in UTF-16 code units the way String.prototype.length counts them. The adapter splits longer text into several text messages on paragraph, line, word, or character boundaries, the same way it splits a streamed reply, and sends them five to a request. The first request goes through the Reply API when a reply token is fresh, and a quoteToken rides on the first message only. Markdown and AST postables are split after rendering.

Text with mentions or emojis is never split, because LINE positions them by offset inside one message. The adapter measures it after mention and emoji placeholders and brace escaping are applied, and throws a ValidationError instead of calling LINE when that passes the cap. A post whose text is empty, or renders to nothing, such as a lone ---, also throws a ValidationError before the adapter calls LINE.

LINE displays no Markdown, so the adapter renders Markdown and AST postables as plain text. It drops emphasis and heading marks. Code keeps its exact text without fences, a link keeps its URL as text (url), and list items keep their - or 1. markers. A task list keeps its [x] and [ ] checkboxes, and a footnote keeps its [1] marker. Inside a table, a link or an image keeps its URL the way it does anywhere else. The adapter never reads inbound text as Markdown either, so message.formatted holds exactly what the user typed.

Quoted replies

Every inbound text, image, video, and sticker message carries a quoteToken. Pass it back on a text postable to quote that message natively:

import { LineMessage, linePostable } from "chat-adapter-line";

bot.onSubscribedMessage(async (thread, message) => {
  if (message instanceof LineMessage) {
    await thread.post(
      linePostable({
        text: "Replying to this one",
        quoteToken: message.quoteToken,
      })
    );
  }
});

quoteToken works on text, raw, markdown, and ast postables and survives both the Reply API and Push API paths. LINE cannot quote from a card or audio message, so combining those with a quoteToken throws a ValidationError rather than sending an unquoted message.

When an inbound message is itself quoting an earlier one, message.quotedMessageId holds LINE's ID for the message being quoted:

bot.onSubscribedMessage(async (thread, message) => {
  if (message instanceof LineMessage && message.quotedMessageId) {
    console.log(message.text, "quotes", message.quotedMessageId);
  }
});

The two fields point in opposite directions: quoteToken is what you send back to quote this message, while quotedMessageId identifies the older message this one quotes. LINE omits quotedMessageId unless the sender actually quoted something. The adapter reports the ID and stops there, because LINE's API offers no way to fetch a message by ID, so resolving the quoted message means looking it up in whatever you stored yourself.

Sending mentions

Mentions need stable character offsets, so the adapter accepts them on text and raw postables only. LINE renders them in group chats and multi-person chats, through the Reply API or Push API, with at most 20 mentions per message. Each segment selects the span of your text that LINE replaces with the mention:

await thread.post(
  linePostable({
    text: "Hello @Alice, please review",
    mentions: [
      { index: 6, length: 6, userId: "U1234567890abcdef1234567890abcdef" },
    ],
  })
);

await thread.post(
  linePostable({
    text: "@everyone stand-up in 5",
    mentions: [{ all: true, index: 0, length: 9 }],
  })
);

The adapter encodes these as a LINE text message v2 with mention substitutions. Passing mentions on a Markdown, AST, card, Flex, audio, location, or sticker postable, in a 1:1 chat, or in a broadcast or multicast throws a ValidationError.

Native emoji

LINE emoji are identified by a product ID and an emoji ID, not by a Unicode character. Put a $ in the text where each one belongs and point an emojis entry at it:

await thread.post(
  linePostable({
    text: "Ship it $",
    emojis: [
      { index: 8, productId: "5ac1bfd5040ab15980c9b435", emojiId: "001" },
    ],
  })
);

The adapter encodes this as a LINE text message v2, the same shape it already uses for mentions, so one message can carry both:

await thread.post(
  linePostable({
    text: "@Alice $ nice work",
    mentions: [
      { index: 0, length: 6, userId: "U1234567890abcdef1234567890abcdef" },
    ],
    emojis: [
      { index: 7, productId: "5ac1bfd5040ab15980c9b435", emojiId: "001" },
    ],
  })
);

Each index must line up with a $, both identifiers must be non-empty, and no two substitutions may cover the same characters, whether they are mentions or emoji. LINE accepts at most 20 mentions and 20 emoji in one message. Anything else throws a ValidationError before the adapter calls LINE. Like mentions, emoji only work on text and raw postables, because a Markdown, AST, card, Flex, audio, location, or sticker postable has no stable character offsets to anchor them to.

Unlike mentions, emoji render everywhere: 1:1 chats, groups, rooms, and broadcastMessages() and multicastMessages() all take them.

Inbound, message.emojis lists the native emoji a user sent, each with index, length, productId, and emojiId. The adapter leaves message.text exactly as LINE sent it, emoji sequences and all, and drops a malformed entry rather than the whole message:

bot.onSubscribedMessage(async (thread, message) => {
  if (message instanceof LineMessage) {
    for (const emoji of message.emojis) {
      console.log(emoji.productId, emoji.emojiId);
    }
  }
});

The Chat SDK's emoji helper (emoji.thumbs_up) is a different, Unicode-based set. The adapter sends it as the Unicode character in text, Markdown, streamed replies, and card text. A text or raw message with positioned mentions or emojis must use Unicode emoji directly. Converting a placeholder there would shift those positions, so the adapter throws a ValidationError.

Flex Messages

A Chat SDK card element renders as a single bubble, with every card element in it, from fields and tables to charts and link buttons. A flex postable covers the rest of the Flex schema, including carousels, URI and datetime-picker actions, colors, and custom layout. The adapter sends contents to LINE untouched:

await thread.post(
  linePostable({
    flex: {
      altText: "Your order shipped",
      contents: {
        type: "bubble",
        hero: {
          type: "image",
          url: "https://example.com/box.png",
          size: "full",
        },
        body: {
          type: "box",
          layout: "vertical",
          contents: [{ type: "text", text: "Arriving Friday", weight: "bold" }],
        },
        footer: {
          type: "box",
          layout: "vertical",
          contents: [
            {
              type: "button",
              style: "primary",
              action: {
                type: "uri",
                label: "Track",
                uri: "https://example.com/track/1",
              },
            },
          ],
        },
      },
    },
  })
);

contents takes a bubble or a carousel. altText is required and must not be blank. LINE caps it at 1500 characters and shows it in notifications and the chat list.

The adapter checks the envelope only. LINE validates the component tree itself, and you know which schema level your payload targets.

Like cards, Flex Messages cannot carry a quoteToken or mentions. Both combinations throw a ValidationError. Delivery uses the same reply-first, push-fallback path as text, and broadcastMessages() and multicastMessages() accept flex postables too.

Buttons and postbacks

LINE reports a tap on a postback action as a postback webhook, and the adapter hands it to bot.onAction(). A card button arrives with its id as event.actionId and its value as event.value.

Any other postback data, from a postback action in a flex postable, a rich menu, or a quick reply, arrives unchanged as event.actionId. To make such an action arrive like a card button instead, build its data with serializePostbackData(id, value). The adapter reads data in that id=…&v=… form as an ID and a value.

A datetime picker's choice arrives as event.value, in LINE's date, time, or datetime format, ahead of any encoded value. event.raw holds the whole LINE postback event:

import { serializePostbackData } from "chat-adapter-line";

const pickDay = {
  type: "datetimepicker",
  label: "Pick a day",
  mode: "date",
  data: serializePostbackData("delivery-day"),
};

bot.onAction("delivery-day", async (event) => {
  await event.thread?.post(`Delivering on ${event.value}`);
});

Generative UI with json-render

@json-render/chat turns a model's JSON spec into a Chat SDK card, and the adapter sends that card as a Flex Message. json-render needs chat 4.43.0 or later. Titles, subtitles, images, text, fields, dividers, tables, charts, and buttons all render in the bubble. A table becomes a grid of rows, and a chart becomes its title over a table of its values, because LINE has no chart component. A link button opens its URL, and a button marked disabled is left out, because LINE has no disabled state.

streamCard() posts a partial card and then edits it as the model writes. LINE cannot edit a sent message, so the first edit rejects with NotImplementedError after a half-built card has already gone out. Pass an updateIntervalMs of Infinity instead. streamCard() then skips every partial card and posts the finished one once:

import { defineCatalog } from "@json-render/core";
import {
  schema,
  standardComponentDefinitions,
  streamCard,
} from "@json-render/chat";
import { streamText } from "ai";

const catalog = defineCatalog(schema, {
  components: standardComponentDefinitions,
});

bot.onDirectMessage(async (thread, message) => {
  await thread.startTyping();
  const result = streamText({
    model: "anthropic/claude-haiku-5.5",
    prompt: message.text,
    system: catalog.prompt(),
  });
  await streamCard(thread, result.textStream, {
    updateIntervalMs: Number.POSITIVE_INFINITY,
  });
});

If the finished spec is invalid, streamCard() throws a CardSpecError before anything is sent, so the reply token is still unused and you can retry. In a 1:1 chat, startTyping() shows LINE's loading animation while the model writes.

LINE does not cap rows or columns, but a phone-width bubble gets hard to read, and LINE rejects a bubble whose JSON is too large. Pass limits in the same options to have json-render reject an oversized spec, for example { tableColumns: 4, tableRows: 20 }.

Inbound media

An image, video, audio, or file message arrives with a Chat SDK attachment that fetches the content on demand, and with message.media describing it without fetching anything:

import { LineMessage } from "chat-adapter-line";

bot.onSubscribedMessage(async (thread, message) => {
  if (!(message instanceof LineMessage) || !message.media) {
    return;
  }

  const { kind, fileName, fileSize, duration } = message.media;
  console.log(kind, fileName, fileSize, duration);

  const [attachment] = message.attachments;
  const bytes = await attachment.fetchData?.();
});

What LINE reports depends on the message: a name and size for files, a duration for audio and video, and a contentProvider saying whether LINE hosts the file or the sender's own app does. providerMessageId is LINE's ID for the message, which is what the content is fetched by. Fields LINE omits, or reports in an unusable shape, are left off rather than guessed at, and a bad one never costs you the attachment.

The attachment itself now carries what the Chat SDK has slots for, so code that never touches message.media benefits too: name is the sender's file name instead of a synthetic one, size is the byte count, and url points at an externally hosted file. LINE serves its own uploads through an authenticated API rather than a public URL, so url stays unset for those and fetchData() remains the way to read them. Fetching is still deferred: nothing is downloaded while the webhook is parsed.

LINE needs time to prepare a large video or audio file before it can serve the bytes. Until it finishes, fetchData() rejects with an AdapterError whose code is CONTENT_NOT_READY, so catch it and call fetchData() again later. For a file the sender's app hosts, fetchData is unset and attachment.url points at the sender-controlled file, so treat whatever it serves as untrusted input.

Images and videos

Pass an image or video object with the media URL and a thumbnail to send a native LINE image or video message:

await thread.post(
  linePostable({
    image: {
      originalContentUrl: "https://example.com/photo.jpg",
      previewImageUrl: "https://example.com/photo-thumb.jpg",
    },
  })
);

await thread.post(
  linePostable({
    video: {
      originalContentUrl: "https://example.com/clip.mp4",
      previewImageUrl: "https://example.com/clip-thumb.jpg",
    },
  })
);

LINE fetches both URLs itself rather than taking bytes from the bot, so each must be HTTPS and at most 2000 characters, and the host has to be reachable from the internet. A missing, non-HTTPS, or over-long URL throws a ValidationError before the adapter calls LINE. Images and videos use the same reply-first, push-fallback delivery as text, and broadcastMessages() and multicastMessages() accept them too. LINE cannot quote from either, so a quoteToken, mentions, or emojis on one throws, as it does on a card.

Hosting and transcoding are yours to handle. The adapter never uploads a file or generates a thumbnail.

Audio messages

Pass an audio object with an HTTPS URL and the length in milliseconds to send a native LINE audio message:

await thread.post(
  linePostable({
    audio: {
      originalContentUrl: "https://example.com/audio.m4a",
      duration: 12_000,
    },
  })
);

The URL must be HTTPS and at most 2000 characters, and the duration a positive integer. Audio uses the same reply-first, push-fallback delivery as text.

Stickers

A sticker message arrives with message.sticker, and a sticker postable sends one back. Passing the inbound sticker straight through echoes it:

import { LineMessage, linePostable } from "chat-adapter-line";

bot.onSubscribedMessage(async (thread, message) => {
  if (message instanceof LineMessage && message.sticker) {
    await thread.post(
      linePostable({
        sticker: message.sticker,
        quoteToken: message.quoteToken,
      })
    );
  }
});

Alongside packageId and stickerId, an inbound sticker carries resourceType, up to 15 keywords describing the sticker, and the text the sender typed on a personalized sticker. Classify a sticker from those fields instead of reading the raw webhook payload. Webhook parsing never downloads or transforms the sticker image.

A bot can only send the stickers in LINE's sticker definitions, so both IDs must be decimal strings and the adapter rejects anything else before calling LINE. It also rejects the four resource types LINE renders from text the sender typed, CUSTOM, MESSAGE, NAME_TEXT, and PER_STICKER_TEXT, rather than sending a different sticker under the same IDs. Stickers use the same reply-first, push-fallback delivery as text, and broadcastMessages() and multicastMessages() accept them too. Unlike a card or audio message, a sticker can carry a quoteToken; mentions throws a ValidationError.

Location messages

A location message arrives with message.location, and a location postable sends a pin back:

import { LineMessage, linePostable } from "chat-adapter-line";

bot.onSubscribedMessage(async (thread, message) => {
  if (message instanceof LineMessage && message.location) {
    const { latitude, longitude } = message.location;
    await thread.post(
      linePostable({
        location: {
          title: "Our office",
          address: "1-3 Kioicho, Chiyoda-ku, Tokyo, 102-8282, Japan",
          latitude,
          longitude,
        },
      })
    );
  }
});

LINE always sends the coordinates on an inbound location, and leaves title and address optional, because a sender can drop a pin without naming it. Coordinates outside the geographic ranges leave message.location unset rather than arriving as a place that looks valid. Webhook parsing makes no geocoding, map, or tile request.

Sending needs all four fields: title and address must be non-blank and at most 100 characters, latitude must fall between -90 and 90, and longitude between -180 and 180. Anything else throws a ValidationError before the adapter calls LINE. Locations use the same reply-first, push-fallback delivery as text, and broadcastMessages() and multicastMessages() accept them too. A LINE location message has no room for a quote, so a quoteToken or mentions on a location postable throws, as it does on a card.

Lifecycle events

LINE reports who the bot can reach through follow, unfollow, join, leave, memberJoined, and memberLeft events. These are not messages, so they never reach onMessage() and are never turned into synthetic text. Subscribe to them on the adapter:

const adapter = createLineAdapter();

const stop = adapter.onLifecycleEvent(async (event) => {
  switch (event.type) {
    case "follow":
      await adapter.postMessage(event.threadId, "Thanks for adding me");
      break;
    case "memberJoined":
      console.log("joined", event.members, "in", event.threadId);
      break;
    default:
      console.log(event.type, event.sourceType, event.sourceId);
  }
});

Every event carries type, threadId, sourceType, sourceId, timestamp, webhookEventId, mode, isRedelivery, and the untouched raw event. userId is set when LINE identifies the acting user, members lists who joined or left, isUnblocked says whether a follow came from an unblock, and replyToken is present only on follow, join, and memberJoined, the three events LINE issues one for.

onLifecycleEvent() returns a function that unsubscribes that handler. Every registered handler sees every event. A handler that throws or rejects is logged and does not stop the others or change the webhook response, which stays 200.

The webhook answers before your handlers finish. On a serverless host, pass waitUntil in the webhook options, as you would for message handlers. The adapter hands it each handler's work, so the runtime keeps running until the handler settles:

import { after } from "next/server";

export const POST = (request: Request) =>
  bot.webhooks.line(request, { waitUntil: (task) => after(() => task) });

LINE issues a reply token with follow, join, and memberJoined, and the adapter stores it, so a welcome message sent from the handler goes out over the free Reply API instead of the quota-metered Push API.

Two behaviors differ from message delivery on purpose. A redelivered lifecycle event is still delivered, with isRedelivery set, because a missed unfollow cannot be recovered the way a missed message can be resent. A standby-mode event is delivered too, with mode set to standby. Filter on those fields, and deduplicate on webhookEventId, which is unique per event. LINE keeps the same ID when it redelivers an event.

Welcoming members with onMemberJoinedChannel

A join and a memberJoined event also reach the Chat SDK's cross-platform onMemberJoinedChannel(), so a welcome written for Slack or Teams works on LINE too:

bot.onMemberJoinedChannel(async (event) => {
  await bot.channel(event.channelId).post("Welcome!");
});

memberJoined calls the handler once for each new member, with that member's userId. A member LINE does not identify is skipped. join, which LINE sends when the bot is added to a group or room, calls it once with the bot's own ID as userId, as Slack does. Compare it with event.adapter.botUserId to tell the bot from a person. LINE sends no inviter, so inviterId is never set. Each group or room is its own channel, so event.channelId names that conversation.

LINE sends one reply token per event, so the first post for that event goes out over the free Reply API, and each later post, such as the second welcome when two people join at once, goes out over the quota-metered Push API. Unlike onLifecycleEvent(), this handler never sees a redelivered or standby-mode event, because the Chat SDK does not deduplicate and a repeated welcome annoys people. leave and memberLeft are not routed, so use onLifecycleEvent() for them.

Broadcast and multicast

broadcastMessages() sends to every follower of the channel and multicastMessages() sends to up to 500 user IDs. Both accept a single postable or an array of up to five, reuse the same conversion as postMessage(), and never consume a reply token:

const adapter = createLineAdapter();

const { requestId } = await adapter.broadcastMessages("New release is out", {
  retryKey: crypto.randomUUID(),
});

await adapter.multicastMessages(
  ["U1234567890abcdef1234567890abcdef", "U2345678901abcdef2345678901abcdef"],
  [{ markdown: "**Reminder**: stand-up at 10" }, "See you there"],
  { retryKey: crypto.randomUUID(), notificationDisabled: true }
);

The adapter forwards retryKey as X-Line-Retry-Key. Reuse the same key when you retry a request whose outcome you don't know, and LINE delivers it once.

Before calling LINE, the adapter validates user IDs, the retry key, and the five-message limit, and throws instead of truncating. 429 responses become AdapterRateLimitError, whose message ends with LINE's reason and whose cause is the LINE SDK's error. The returned requestId is LINE's X-Line-Request-Id, which you can use to reconcile the submission.

License

MIT

Run benchmarks

This package includes targeted benchmarks for hot paths:

  • Markdown normalization (toPlainText)
  • Thread ID encode and decode
  • Webhook signature verification and parsing

Run benchmarks:

bun run benchmark

Export JSON results:

bun run benchmark:json

About

Chat SDK adapter for Line

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages