Help Center/ Object Storage Service/ SDK Reference/ BrowserJS/ Initialization/ Configuring an Instance of ObsClient
Updated on 2024-12-03 GMT+08:00

Configuring an Instance of ObsClient

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference.

You can set the following initialization parameters to configure an instance of ObsClient:

Parameter

Description

Recommended Value

access_key_id

AK

N/A

secret_access_key

SK

N/A

server

Endpoint for accessing OBS, which contains the protocol type, domain name (or IP address), and port number. For example, https://your-endpoint:443. For security purposes, you are advised to use HTTPS.

N/A

timeout

The total timeout period (in seconds) of an HTTP/HTTPS request. The default value is 300.

[10,300]

is_cname

Whether to use self-defined domain name to access OBS. The default value is false.

N/A

useRawXhr

Whether to use the native XHR to send Ajax requests. The default value is false.

N/A

  • Parameters whose recommended value is N/A need to be set according to the actual conditions.
  • If the network is unstable or the size of the file to be uploaded is large, you are advised to set a larger value for timeout.