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: pooriaarab/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
import.meta.envuntyped — Vite + TS needssrc/vite-env.d.tswith thevite/clientreference (TS2339 otherwise).- 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.
- 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 (
platformTypestring); list upcoming posts.
Submission — Replit Extensions store
Submittable: portal-review. Develop against the extension dev tools, then publish to the Replit Extensions store for review. Note the audience is developers — social-publishing fit is narrow; scope the value accordingly.
Silent-rejection gotchas: over-typed wrappers; missing vite-env.d.ts; unclear value for a dev audience. TBD — confirm current store submission steps at first submission.
Parity checklist
paste + validate your API key · compose + schedule a post (platformType) · list posts · surface success/error.
Related skills
raycast-extension— the other developer-power-user command surface.browser-extension— sibling per-device-storage tool.