replit-extension

Installation
SKILL.md

Building a Replit Extension

A Replit Extension is a React tool panel inside the Replit workspace, built on the Replit Extensions API (@replit/extensions). Source lives in integrations/<name>/. Thin frontend over your own backend — useful for "announce a shipped Repl" flows. Playbook: itsryanarmani/scripts scripts/replit-extension/README.md.

The trap that cascades: over-typed result wrappers

A local helper that asserts a client method returns exactly { data: T[] } — when the SDK actually returns { data?: T[] | undefined } or T[] | { data: T[] } — produces a wall of TS2352 / TS2345 "not comparable / not assignable" errors that cascade through every caller. Fix the shape at the boundary: type the wrapper to the SDK's actual return (optional/union), and narrow with Array.isArray(x) ? x : x.data ?? [] at the call site. Don't paper it with any.

The other traps

  1. import.meta.env untyped — Vite + TS needs src/vite-env.d.ts with the vite/client reference (TS2339 otherwise).
  2. Workspace panel, not a page — the extension mounts in Replit's tool dock; store the API key in the extension's own storage, per-user.
  3. Manifest/config declares the tool + permissions; a placeholder id runs in dev but not published.

Build path

  • React panel on @replit/extensions (New Post / Queue / Accounts commands map well); npm run build.
  • Compose/schedule a post via your API (platformType string); list upcoming posts.
Installs
1
GitHub Stars
1
First Seen
Nov 15, 2026