KlangDocs
Open Klang

Klang developer docs

Build on Klang

Guides and reference for connecting your tools to Klang. Start with webhooks, which take the same URL and JSON as Discord’s; bots and a public API come later.

Post messages, rich embeds and GitHub activity to a channel with a secret URL. Tools that already post to Discord work by pasting the Klang URL.

Bots & API

Coming soon

Bots and a public API for Klang. Coming soon.

Send your first message

You need a server where you have the Manage webhooks permission. Owners and administrators have it.

  1. In Klang, open Server settings › Integrations › Webhooks and create a webhook. Pick its name, its avatar and the channel it posts to.
  2. Copy its URL. It looks like https://api.klang.gg/api/webhooks/{webhook.id}/{webhook.token}, and anyone who has it can post in that channel, so keep it private.
  3. Send it a POST with some JSON:
curl -X POST "$KLANG_WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -d '{"content": "Hello from a webhook."}'
await fetch(process.env.KLANG_WEBHOOK_URL, {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ content: 'Hello from a webhook.' }),
});
import os
import requests

requests.post(os.environ["KLANG_WEBHOOK_URL"], json={"content": "Hello from a webhook."})

The message shows up in the channel at once, with the webhook’s name and avatar. From there: everything the request accepts, rich embeds and GitHub.