Type-safe RPC between iframes. Call methods across frames like they're local functions. No glue code, no message parsing, no postMessage boilerplate. Works in both TypeScript and vanilla JavaScript. Types are optional. Use cases: - Micro-frontends communicating across domains - Embedded widgets (payments, auth, analytics) - Secure sandboxed apps Features: - Typed RPC over postMessage - Promise-based async calls - Automatic handshake + origin validation - Functional and OOP APIs - Works cross-origin, no server, no bundler required - ESM + CJS builds How it works: The child exposes an API. The parent connects via a secure handshake. All method calls are proxied over postMessage as typed async RPC. Why RPC-iFrame: If you work with iframes, you know the pain: raw postMessage, manual serialization, no types, origin checks scattered everywhere, zero error context when something breaks. RPC-iFrame replaces all of that with a single abstraction: typed RPC. You define an interface, expose it from the child, and call it from the parent. The runtime handles handshakes, security, and cleanup. GitHub: AdriAir/RPC-iFrame NPM: rpc-iframe #javascript #typescript #webdev #webdevelopment #programming #coding #opensource #npm #devtools #frontend #frontenddevelopment #softwareengineering #webarchitecture #iframe #rpc #indiedev #buildinpublic

This looks like a really solid solution for the iframe headaches we've all dealt with. The type safety aspect alone would save so much debugging time in complex micro-frontend setups.

Like
Reply

To view or add a comment, sign in

Explore content categories