@synonymdev/pubky
    Preparing search index...

    Class Client

    Low-level HTTP bridge used by the Pubky facade and actors.

    • Supports http(s):// URLs targeting Pubky or ICANN hosts.
    • In browsers/undici, passes credentials: "include" to send cookies.
    Index
    • Create a Pubky HTTP client.

      Parameters

      Returns Client

      A configured low-level client. Prefer new Pubky().client unless you need custom relays/timeouts.

      If any PKARR relay URL is invalid.

      const client = new Client({
      pkarr: { relays: ["https://relay1/","https://relay2/"], request_timeout: 8000 }
      });
      const pubky = Pubky.withClient(client);
    • Returns void

    • Perform a raw fetch. Works with http(s):// URLs.

      Parameters

      • url: string
      • Optionalinit: RequestInit | null

        Standard fetch options; credentials: "include" recommended for session I/O.

      Returns Promise<Response>

      const client = pubky.client;
      const res = await client.fetch(`https://_pubky.${user}/pub/app/file.txt`, { method: "PUT", body: "hi", credentials: "include" });
    • Returns void

    • Create a client wired for local testnet.

      Configures PKARR relays for the testnet and remembers the hostname for WASM _pubky mapping.

      Parameters

      • Optionalhost: string | null

        Testnet hostname or IP.

      Returns Client

      A client ready to talk to your local testnet.

      const client = Client.testnet();           // localhost
      const pubky = Pubky.withClient(client);
      const client = Client.testnet("docker0");  // custom host