Documentation
    Preparing search index...
    • Build a React Native peerkit transport. Configures libp2p with WebSockets (outbound) + WebRTC + circuit-relay-v2 client + noise + yamux + identify.

      Noise is wired with quickCryptoNoise, the JSI-backed ICryptoInterface from ./quick-crypto-noise, so SHA-256, HKDF, and ChaCha20-Poly1305 are offloaded to react-native-quick-crypto. X25519 stays on pure JS because ICryptoInterface is synchronous and quick-crypto's X25519 surface is not.

      Crypto primitives, RNG and the WebRTC globals come from runtime polyfills — the consumer must import @peerkit/transport-libp2p-react-native/polyfills once from the app entry before this factory runs.

      Handles all three peerkit protocols (access, agents, messages). DCUtR is deliberately not registered: mobile cannot listen on TCP/QUIC, so there is no relayed connection that can be upgraded by hole-punching; WebRTC ICE provides the only viable direct-connection path on mobile.

      Parameters

      Returns Promise<ITransport>