@backblaze-labs/b2-sdk - v0.4.0
    Preparing search index...

    Class PartnerRawClient

    Low-level client for Partner API authorization and endpoint bindings.

    Index
    • Calls b2_authorize_account with Master Application Key credentials and normalizes the Partner/Backup suites into a Partner-specific auth shape.

      The Partner API documentation currently shows the v3 authorize path, so this method intentionally uses /b2api/v3/b2_authorize_account while the storage raw client keeps using v4.

      Parameters

      • masterKeyId: string

        The Master Application Key ID for authentication.

      • masterKey: string

        The Master Application Key secret.

      • realmUrl: string = DEFAULT_PARTNER_REALM_URL

        The B2 realm URL to authenticate against.

      • Optionaloptions: PartnerRawRequestOptions

        Optional abort and per-request retry settings.

      Returns Promise<PartnerAuthorizeResponse>

      The normalized Partner authorization response.

      B2RealmConfigurationError if the realm URL is unsafe for Master Application Key credentials.

      B2PartnerAuthorizationError if the response omits or returns unsafe Partner endpoint data.

    • Experimental

      Calls b2_reserve_trial_create_account.

      The Partner API creates one new Backblaze B2 account and starts a B2 Reserve trial for it. The wire request and success response are single JSON objects.

      Each email address must not already be a Backblaze account. term is the trial duration in days, documented as 7 through 30 inclusive. storage is the requested storage in TB, documented as 1 through 50 inclusive.

      This operation is non-idempotent and creates billable accounts. Automatic retries and expired-token reauthorization are disabled; long-lived callers must catch auth expiry, reauthorize, and then decide whether to issue a new request. A network or timeout failure after the server has processed the request may still have created an account, and the application key from a lost response is not recoverable from B2. Callers should reconcile account state out of band, such as through Partner account listing, before re-issuing a request for the same email address.

      Parameters

      • groupsApiUrl: string

        The Partner API base URL from authorizePartner. The authorize response currently exposes the shared Partner endpoint base as groupsApiUrl.

      • authToken: string

        The Partner API authorization token.

      • request: ReserveTrialCreateAccountRequest

        Email, term, storage, and optional region for the account to create.

      • Optionaloptions: PartnerRawRequestOptions

        Optional abort and per-request retry settings.

      Returns Promise<ReserveTrialCreateAccountResult>

      The created reserve-trial account result.

      Partner API surface; shape may change as the Partner API docs evolve.