← ClaudeAtlas

json-render-slacklisted

Turn a json-render spec (vercel-labs/json-render, @json-render/chat) into a native Slack message — Block Kit with real charts (data_visualization), tables (data_table), fields and link buttons — and post it through a plain Slack Incoming Webhook, with no Slack bot, Chat SDK instance or bot token. Use this whenever someone wants a "pretty", card-like or chart-filled Slack message built from data (reports, digests, alerts, metrics, KPIs, weekly summaries), mentions json-render or @json-render/chat together with Slack, wants to replace a plain-text/mrkdwn Slack webhook post with something richer, or asks how to render generative UI in Slack without building a bot. Also use it to debug such messages (a chart that shows up as a code block, Slack rejecting blocks, a spec that throws CardSpecError).
SergeyGalaxyOrsik/json-render-slack · ★ 0 · Data & Documents · score 72
Install: claude install-skill SergeyGalaxyOrsik/json-render-slack
# json-render → Slack (Incoming Webhook, no bot) json-render's chat renderer (`@json-render/chat`) was built for the Vercel Chat SDK, whose docs assume a Slack **bot** (`SLACK_BOT_TOKEN`, signing secret, `thread.post`). Most "send a report to a channel" jobs only have an **Incoming Webhook URL**. You don't need the bot: the two pure functions in the middle of that pipeline work on their own. ``` Spec (JSON) ──toCard()──▶ CardElement ──cardToSlackBlocks()──▶ Block Kit ──POST──▶ webhook @json-render/chat @chat-adapter/slack/blocks { text, blocks } ``` Neither function talks to Slack or needs credentials, and both are side-effect free, so they are easy to unit-test. ## Install ```bash bun add @json-render/core @json-render/chat @chat-adapter/slack chat zod # or npm i / pnpm add the same list ``` `chat` is only a peer dependency, used for the `CardElement` type; nothing from it runs. Verified with `@json-render/chat@0.22.0`, `@chat-adapter/slack@4.45.0`, `chat@4.45.0`. If the installed versions differ a lot, run `scripts/spec-to-blocks.ts` on a sample spec before relying on the mapping below. ## The core code ```ts import type { Spec } from "@json-render/core"; import { toCard } from "@json-render/chat"; import { cardToSlackBlocks, cardToSlackFallbackText, type SlackBlock, type SlackCardElement } from "@chat-adapter/slack/blocks"; export function specToSlack(spec: Spec): { text: string; blocks: SlackBlock[] } { // Chat SDK's CardEleme