A ponyfill library extending browser and Node.js HTTP implementations to support Braid-HTTP, turning state transfer into state synchronization. Currently at version 1.3.125, with regular releases. Key differentiators: drop-in replacement for fetch() in browsers, adds capabilities to Node.js http/https/http2 modules, conforms to Braid-HTTP v04 spec with HTTP Multiresponse and Multiplexing extensions. Compared to alternatives, this is the primary implementation of the Braid protocol, providing subscription-based real-time updates and automatic reconnection.
npm install braid-httpVerified import paths — ran on the pinned version, not inferred.
Demonstrates subscribing to a resource with automatic reconnection.
Use 'import { fetch } from 'braid-http'' instead of 'import braidFetch from 'braid-http''.Use <script src='https://unpkg.com/braid-http/braid-http-client.js'></script> then window.fetch = braid_fetch.
Use 'if (update.patches) { ... } else { ... }' to handle patches vs. full body.Set 'parents: () => current_parents' to dynamically update version on reconnect.
Use 'const { fetch } = require('braid-http')' for CJS or 'import { fetch } from 'braid-http'' for ESM.Run 'npm install braid-http' and ensure import path is correct.
Use 'import { fetch } from 'braid-http'' instead of 'import braid_http from 'braid-http''.Include <script src='https://unpkg.com/braid-http/braid-http-client.js'></script> before calling braid_fetch.
Ensure you are using the braid-http fetch: 'import { fetch } from 'braid-http''.