How to Connect Openclaw to LINE: Step-by-Step Guide
Integrating Openclaw with LINE allows your AI agent to receive and respond to messages from LINE users. This guide walks you through installing the LINE plugin and configuring your Gateway to handle LINE messages.
Prerequisites
Before starting, ensure you have:
- An Openclaw Gateway running
- A LINE Official Account with Channel Access Token and Channel Secret
- CLI access to your Openclaw installation
Install the LINE Plugin
LINE support is provided via a plugin that acts as a webhook receiver on your Gateway. Install it using the CLI:
Openclaw plugins install @Openclaw/line
Alternatively, you can manually configure your ~/.Openclaw/Openclaw.json file to include the LINE channel.
Configure LINE Credentials
Add your LINE Channel Access Token and Channel Secret to your Openclaw configuration:
{
"channels": {
"line": {
"enabled": true,
"channelAccessToken": "YOUR_LINE_CHANNEL_ACCESS_TOKEN",
"channelSecret": "YOUR_LINE_CHANNEL_SECRET",
"dmPolicy": "pairing"
}
}
}
Replace YOUR_LINE_CHANNEL_ACCESS_TOKEN and YOUR_LINE_CHANNEL_SECRET with your actual credentials from the LINE Developers Console.
Understanding DM Policy
The dmPolicy setting controls how direct messages are handled:
- pairing: Users must be explicitly paired with an agent before messaging
- open: Any LINE user can message your bot without prior pairing
For production use, we recommend pairing to prevent unauthorized access.
Restart Your Gateway
After configuration, restart your Gateway to apply changes:
Openclaw gateway restart
If running manually, stop the process and start it again.
Test Your Integration
Send a message to your LINE Official Account. Your Openclaw agent should receive the message and respond based on its configured behavior.
For more messaging integrations, check out our guides on Connect Zalo Openclaw and Telegram Integration.
Troubleshooting
| Issue | Solution |
|---|---|
| Messages not received | Verify webhook URL is accessible and Channel Secret is correct |
| Authentication errors | Check Channel Access Token has not expired |
| Bot not responding | Ensure Gateway is running and agent is properly configured |
Best Practices
- Store credentials in environment variables instead of hardcoding in JSON
- Use pairing policy for production deployments
- Monitor Gateway logs for webhook delivery issues
- Set up proper error handling for failed message deliveries
Your Openclaw agent is now connected to LINE and ready to handle conversations!