One-click connections
Without any setup, a business connects Slack, Discord or Telegram by pasting a webhook URL or bot token. If the agency registers one Slack app, one Discord app and one Telegram bot, every business gets a Connect button instead: one click, pick a channel, done. You do this once for all clients.
| Channel | What you create (once) | What a business does | Extra |
|---|---|---|---|
| Slack | A Slack app from the manifest below | Connect with Slack, pick a channel | Contacted, Won and Lost buttons on each lead |
| Discord | A Discord application (no bot needed) | Connect with Discord, pick server and channel | — |
| Telegram | A bot from @BotFather | Connect with Telegram, press Start or add the bot to a group | Contacted, Won and Lost buttons on each lead |
| Teams, email, webhook, Sheets | Nothing | Paste a URL or address | — |
The addresses below use this deployment, https://leadvane.cowebofficial.workers.dev. If you move to a custom domain, change them to match APP_URL in wrangler.jsonc.
Slack app
Do you need a Slack app? Only for the one-click button and the status buttons. A pasted incoming webhook works without one. You do not need to list the app in the Slack Marketplace: a distributed, unlisted app can be installed into any workspace through the Connect button.
- Go to api.slack.com/apps → Create New App → From a manifest, pick your agency's workspace and paste the manifest (also in the repository at
integrations/slack/manifest.yml):
display_information:
name: Leadvane
description: New website leads, with Contacted, Won and Lost buttons.
background_color: "#0d0f1a"
oauth_config:
redirect_urls:
- https://leadvane.cowebofficial.workers.dev/api/connect/slack/callback
scopes:
bot:
- incoming-webhook
settings:
interactivity:
is_enabled: true
request_url: https://leadvane.cowebofficial.workers.dev/connect/slack/interactions
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false- Under Basic Information copy the Client ID, Client Secret and Signing Secret.
- Under Manage Distribution, tick the checklist and press Activate Public Distribution, so clients' workspaces can install it.
- Add them to Leadvane:
# wrangler.jsonc → vars.SLACK_CLIENT_ID = "1234567890.1234567890"
npx wrangler secret put SLACK_CLIENT_SECRET
npx wrangler secret put SLACK_SIGNING_SECRET
npm run deployHow it works: the dashboard sends the user to Slack with the incoming-webhook scope and a signed, 15-minute state. Slack asks them to pick a channel and returns a webhook URL for it, which is stored encrypted. When someone presses Won in Slack, Slack posts the click to /connect/slack/interactions, signed with your signing secret; Leadvane checks the signature, checks the click came from the workspace connected to that lead's website, updates the lead and replaces the buttons with "Won · marked by Asha in Slack".
Discord application
- Open the Discord Developer Portal → New Application, name it Leadvane.
- Under OAuth2 add the redirect
https://leadvane.cowebofficial.workers.dev/api/connect/discord/callbackand copy the Client ID and Client Secret. You don't need a bot. - Add them to Leadvane:
# wrangler.jsonc → vars.DISCORD_CLIENT_ID = "123456789012345678"
npx wrangler secret put DISCORD_CLIENT_SECRETDiscord's webhook.incoming scope asks the user for a server and channel and hands back a webhook for it. Leadvane keeps only the webhook, encrypted.
Telegram bot
- In Telegram, message @BotFather, send
/newbotand follow the prompts. Copy the token. - Optional:
/setdescriptionand/setuserpicso clients recognise it. - Add it to Leadvane. The webhook is registered automatically the first time someone presses Connect.
# wrangler.jsonc → vars.TELEGRAM_BOT_USERNAME = "YourAgencyLeadsBot" (without @)
npx wrangler secret put TELEGRAM_BOT_TOKENHow it works: Connect with Telegram creates a one-time code (15 minutes) and opens t.me/YourBot?start=CODE, or ?startgroup=CODE to add the bot to a group. Telegram delivers /start CODE to /connect/telegram/webhook with a secret header only Leadvane knows; Leadvane creates the notification for that chat and replies "Connected". The dashboard sees it within a few seconds. Lead messages carry Contacted, Won and Lost buttons that only work in the chat that was connected.
Telegram only calls https addresses, so the Telegram button works on your deployed Leadvane, not on localhost. Slack and Discord also need their redirect URLs to match APP_URL exactly.
Security
- OAuth state is signed with
SESSION_SECRET, expires after 15 minutes, and only completes in the same signed-in session that started it. - Webhook URLs and tokens are encrypted at rest with
CONFIG_KEYand masked in the dashboard. - Slack clicks are verified with the signing secret and a 5-minute replay window. Telegram calls must carry the webhook secret.
- A button can only change a lead whose website is connected to that same Slack workspace or Telegram chat.