@uploadcare/upload-client
    Preparing search index...

    Type Alias AuthToken

    AuthToken: string | (() => string | Promise<string>)

    JWT for the Upload API Authorization: Bearer <token> scheme. Accepts a plain token or a resolver function; the resolver is called before every request, so long-running uploads (e.g. multipart) can supply a fresh token mid-flight.

    This client never stores a token between calls. Rather than fetching one per request, pass the bound getToken of an AuthTokenCache from @uploadcare/signed-uploads/client, which holds the token and replaces it shortly before it expires:

    const tokens = new AuthTokenCache({ fetchToken })
    uploadFile(file, { publicKey, authToken: tokens.getToken })

    Mint tokens on your server with generateAuthToken from @uploadcare/signed-uploads — it needs the project secret key.

    Takes precedence over legacy secureSignature / secureExpire: when both are provided, only the Authorization header is sent.