• Returns a new URL having a signature parameter.

    const signedUrl = signUrl("https://example.com/some-path?foo=bar", "secret");
    signedUrl.href; // "https://example.com/some-path?foo=bar&signature=..."

    Parameters

    • unsignedUrl: string | URL

      The URL to sign.

    • secret: string

      The secret to use for signing.

    Returns URL

    The signature of the signed url.