This topic describes the parameters that you can configure when you initialize Object Storage Service (OSS) SDK for Node.js.

The following table describes the parameters (options).
Parameter Type Description
accessKeyId String The AccessKey ID that is created in the Alibaba Cloud Management Console.
accessKeySecret String The AccessKey secret that is created in the Alibaba Cloud Management Console.
stsToken String The temporary Security Token Service (STS) token that is used to access OSS. For more information, see Use STS for temporary access authorization
bucket String The bucket that is created by using the OSS console or by calling the PutBucket operation.
endpoint String The endpoint that is used to access your OSS bucket.
region String The region where your bucket is located. Default value: oss-cn-hangzhou.
internal Boolean Specifies whether to use the Alibaba Cloud internal network to access OSS. Default value: false. For example, set this parameter to true if you use an Elastic Compute Service (ECS) instance to access OSS. The ECS instance accesses OSS by using an internal endpoint, which reduces costs.
cname Boolean Specifies whether a custom domain name can be used to access OSS. Default value: false. If you set cname to true, you must map a CNAME record to your bucket before you use the custom domain name to access the bucket.
isRequestPay Boolean Specifies whether the pay-by-requester mode is enabled for your bucket. Default value: false. For more information, see Enable pay-by-requester.
secure Boolean Specifies whether HTTPS is used to access OSS. A value of true indicates that HTTPS is used to access OSS. A value of false indicates that HTTP is used to access OSS. For more information, see FAQ.
timeout String|Number The timeout period. Default value: 60000. Unit: milliseconds.

The following code provides an example on how to configure parameters when you use OSS SDK for Node.js:

var oss = require('ali-oss');

var client = new oss({
 // Specify the region in which the bucket is located. For example, if the bucket is located in the China (Hangzhou) region, set the region to oss-cn-hangzhou. 
  region: 'yourRegion',
  // The AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations in OSS is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M. To create a RAM user, log on to the RAM console. 
  accessKeyId: 'yourAccessKeyId',
  accessKeySecret: 'yourAccessKeySecret',
  // Specify the name of the bucket. 
  bucket: 'examplebucket'
});