@synonymdev/pubky
    Preparing search index...

    Class PubkyResource

    An addressed resource: a user's public key paired with an absolute path.

    This represents a specific file or directory on a user's homeserver.

    // Parse from a pubky URL
    const resource = PubkyResource.parse("pubky://o1gg96ewuojmopcjbz8895478wdtxtzzuxnfjjz8o8e77csa1ngo/pub/example.txt");
    console.log(resource.owner.z32()); // The user's public key
    console.log(resource.path); // "/pub/example.txt"
    console.log(resource.toPubkyUrl()); // "pubky://o1gg96.../pub/example.txt"
    Index
    owner: PublicKey

    Get the owner's public key.

    path: string

    Get the absolute path (e.g., "/pub/example.txt").

    • Returns void

    • Returns void

    • Render as pubky://<owner>/<path> (deep-link/URL form).

      Returns string

    • Render as pubky<owner>/<path> (identifier form).

      Returns string

    • Parse a pubky resource from a string.

      Accepts:

      • pubky://<public_key>/<path> (URL form)
      • pubky<public_key>/<path> (identifier form)

      Parameters

      • value: string

        The resource string to parse

      Returns PubkyResource

      • The parsed resource
      • If the string is not a valid pubky resource