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

    Function createS3ClientConfig

    • Derives an S3-compatible client configuration from B2 authorization state. Pass the result to new S3Client(config) from @aws-sdk/client-s3.

      Parameters

      • config: B2S3Config

        B2 auth state, application key credentials, and optional region override.

      Returns S3ClientConfig

      Configuration ready for the AWS S3 SDK.

      const { B2_APPLICATION_KEY_ID, B2_APPLICATION_KEY } = process.env
      if (!B2_APPLICATION_KEY_ID || !B2_APPLICATION_KEY) throw new Error('Missing B2 credentials')
      const s3 = new S3Client(createS3ClientConfig({
      accountInfo: client.accountInfo,
      applicationKeyId: B2_APPLICATION_KEY_ID,
      applicationKey: B2_APPLICATION_KEY,
      }))