coderClaw

LINE (plugin)

LINE connects to CoderClaw via the LINE Messaging API. The plugin runs as a webhook receiver on the gateway and uses your channel access token + channel secret for authentication.

Status: supported via plugin. Direct messages, group chats, media, locations, Flex messages, template messages, and quick replies are supported. Reactions and threads are not supported.

Plugin required

Install the LINE plugin:

coderclaw plugins install @coderclaw/line

Local checkout (when running from a git repo):

coderclaw plugins install ./extensions/line

Setup

  1. Create a LINE Developers account and open the Console: https://developers.line.biz/console/
  2. Create (or pick) a Provider and add a Messaging API channel.
  3. Copy the Channel access token and Channel secret from the channel settings.
  4. Enable Use webhook in the Messaging API settings.
  5. Set the webhook URL to your gateway endpoint (HTTPS required):
https://gateway-host/line/webhook

The gateway responds to LINE’s webhook verification (GET) and inbound events (POST). If you need a custom path, set channels.line.webhookPath or channels.line.accounts.<id>.webhookPath and update the URL accordingly.

Configure

Minimal config:

{
  channels: {
    line: {
      enabled: true,
      channelAccessToken: "LINE_CHANNEL_ACCESS_TOKEN",
      channelSecret: "LINE_CHANNEL_SECRET",
      dmPolicy: "pairing",
    },
  },
}

Env vars (default account only):

Token/secret files:

{
  channels: {
    line: {
      tokenFile: "/path/to/line-token.txt",
      secretFile: "/path/to/line-secret.txt",
    },
  },
}

Multiple accounts:

{
  channels: {
    line: {
      accounts: {
        marketing: {
          channelAccessToken: "...",
          channelSecret: "...",
          webhookPath: "/line/marketing",
        },
      },
    },
  },
}

Access control

Direct messages default to pairing. Unknown senders get a pairing code and their messages are ignored until approved.

coderclaw pairing list line
coderclaw pairing approve line <CODE>

Allowlists and policies:

LINE IDs are case-sensitive. Valid IDs look like:

Message behavior

Channel data (rich messages)

Use channelData.line to send quick replies, locations, Flex cards, or template messages.

{
  text: "Here you go",
  channelData: {
    line: {
      quickReplies: ["Status", "Help"],
      location: {
        title: "Office",
        address: "123 Main St",
        latitude: 35.681236,
        longitude: 139.767125,
      },
      flexMessage: {
        altText: "Status card",
        contents: {
          /* Flex payload */
        },
      },
      templateMessage: {
        type: "confirm",
        text: "Proceed?",
        confirmLabel: "Yes",
        confirmData: "yes",
        cancelLabel: "No",
        cancelData: "no",
      },
    },
  },
}

The LINE plugin also ships a /card command for Flex message presets:

/card info "Welcome" "Thanks for joining!"

Troubleshooting