B2 auth state, application key credentials, and optional region override.
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,
}))
Derives an S3-compatible client configuration from B2 authorization state. Pass the result to
new S3Client(config)from@aws-sdk/client-s3.