yeetpostyeetpost

How to sendfrom

Follow these steps to connect Discord message, send from TypeScript, and track delivery.

Discord posting goes through a webhook you create yourself in the channel's settings. There is no bot to install and no OAuth dance: Discord hands you a URL, yeetpost calls it once to read back the webhook's name and channel, and messages land under the name and avatar you gave it. The URL is a credential, so treat it like an API key. In plain TypeScript this is a few lines in any Node process: a worker, a one-off script or a deploy step that already knows what to say.

What Discord takes

How you connectA webhook URL of the form https://discord.com/api/webhooks/<id>/<token>
Connection slugdiscord for the first channel, then a slug built from the webhook name
Text limit2000 characters, counted in code points
ImagesUp to 5 per post, png, jpeg, gif or webp, 8 MB each
Alt textYes, sent as each attachment's description
ThreadsNo, a webhook cannot reply to its own message
First commentNo, LinkedIn only
SchedulingYes
Permalinkhttps://discord.com/channels/<server>/<channel>/<message>
Per-post feeNone
1

Connect your platform

Connect a Discord channel to yeetpost with a webhook you create yourself:

  1. In Discord, open the channel's settings, then Integrations, then Webhooks
  2. Click New Webhook, give it a name and an avatar, and click Copy Webhook URL
  3. Go to app.yeetpost.com
  4. Click Add connection, select Discord, and paste the URL

The URL has to be a real Discord webhook URL, so https://discord.com/api/webhooks/<id>/<token>. Anyone holding it can post to that channel, so treat it like an API key. To revoke it, delete the webhook in Discord.

Paste your connection slug here and we'll auto-fill it into the code examples below.

2

Get your API key

Get your API key from the yeetpost dashboard:

  1. Go to app.yeetpost.com/app/settings
  2. Copy your API key

Paste your API key here and we'll auto-fill it into the code examples below.

3

Send your post

Install the yeetpost package:

npm install yeetpost

Export your API key so the process can read it:

export YEETPOST_API_KEY=<your-api-key>

Send a post:

import { yeetpost } from "yeetpost"; await yeetpost({ connection: "<your-connection-slug>", text: "Hello from yeetpost!", });

To post to several connections in one call, use the JSON endpoint. It answers with one result per connection and accepts an Idempotency-Key, so a retry cannot double-post:

const response = await fetch("https://api.yeetpost.com/api/v2/posts", { method: "POST", headers: { "x-api-key": process.env.YEETPOST_API_KEY!, "content-type": "application/json", "Idempotency-Key": crypto.randomUUID(), }, body: JSON.stringify({ text: "Hello from yeetpost!", connectionSlugs: ["<your-connection-slug>"], }), }); const { results } = await response.json(); for (const result of results) { console.log(result.connectionSlug, result.status, result.url); }

Read each result.status rather than the HTTP status alone: one connection can fail while the rest go out.

4

Track your posts

Monitor all your posts from the yeetpost dashboard:

  1. Go to the Feed tab in the yeetpost dashboard
  2. View all posts sent via yeetpost, including status and timestamps
5

Review the security checklist

Review the Security Checklist to ensure your implementation is secure.

When a Discord post is refused

Each of these fails only the Discord item. Every other connection on the same request still goes out. The full vocabulary is in the errors reference.

CodeStatusWhen
invalid_request400Text over 2000 code points
media_unsupported400The server refused the image, usually its own upload limit
shape_unsupported400A thread or a firstComment was given. Discord has neither
platform_rejected422The webhook is gone, is no longer allowed to post, is rate limited past 5 seconds, or Discord refused the message
internal_server_error500Our fault. Quote the req_id when you report it

Discord FAQ

Why can I not send a thread to Discord?

A webhook posts messages, it cannot reply to one. Ask for a thread on a Discord connection and that item is refused with shape_unsupported, while the connections that do have threads, X, Bluesky, Telegram and Mastodon, still go out.

Can I post to several Discord channels?

Yes. One webhook per channel and one connection per webhook. Name them all in connectionSlugs and the same call fans out to every channel.

The webhook stopped working. What happened?

Somebody deleted it in Discord, or the channel's permissions changed. Posts come back platform_rejected with a message naming which of the two it was. Create a new webhook and paste the new URL.

Does the message show my name?

No. It shows the name and the avatar you gave the webhook when you created it in Discord. Change them there and every later message follows.

Does the yeetpost package work outside Node?

It is a thin wrapper over the same HTTP endpoint, so anywhere you have fetch and can keep a secret it works. Do not run it in a browser bundle: the key would be readable by anyone loading the page.

Related guides

Related resources

Copy this guide (with your values) for use with LLMs or sharing with colleagues.