tencent cloud

CloudBase

Product Introduction
Product Overview
Features and Strengths
Use Cases
System Limits
Purchase Guide
Product Pricing
Description Of Billing Capability Items
Yearly/Monthly Subscription Package Description
Alarm and Notification
Overdue Payment Instructions
Development Guide
Cloud Storage
Database
Identity Verification
Cloud function
Static website management
SDK Documentation
Client SDK
Server SDKs
Management-side SDK
Product Agreement
Cloud Development Service Level Agreement

Web SDK

Focus Mode
Font Size
Last updated: 2025-11-26 10:00:40
@cloudbase/js-sdk allows you to access Cloudbase services and resources using JavaScript on the web (e.g., PC web pages, WeChat public platform H5, etc.).

Installing

Method 1: Introducing Via a Package Manager

#npm
npm install @cloudbase/js-sdk -S
# yarn
yarn add @cloudbase/js-sdk

Method 2: Introducing Via CDN

There are two methods to introduce via CDN:
Import the full SDK
Import feature modules as needed
<script src="//static.cloudbase.net/cloudbase-js-sdk/${version}/cloudbase.full.js"></script>
<script>
const app = cloudbase.init({
env: "your-env-id"
});
</script>

<!-- Kernel -->
<script src="//imgcache.qq.com/qcloud/cloudbase-js-sdk/${version}/cloudbase.js"></script>
<!-- Login Module -->
<script src="//imgcache.qq.com/qcloud/cloudbase-js-sdk/${version}/cloudbase.auth.js"></script>
<!-- Cloud Function Module -->
<script src="//imgcache.qq.com/qcloud/cloudbase-js-sdk/${version}/cloudbase.functions.js"></script>
<!-- Cloud Storage Module -->
<script src="//imgcache.qq.com/qcloud/cloudbase-js-sdk/${version}/cloudbase.storage.js"></script>
<!-- Cloud Database Module -->
<script src="//imgcache.qq.com/qcloud/cloudbase-js-sdk/${version}/cloudbase.database.js"></script>
<!-- Real-time push module, the cloud database module must be included first -->
<script src="//imgcache.qq.com/qcloud/cloudbase-js-sdk/${version}/cloudbase.realtime.js"></script>
<!-- Ad reporting module -->
<script src="//imgcache.qq.com/qcloud/cloudbase-js-sdk/${version}/cloudbase.analytics.js"></script>
<script>
const app = cloudbase.init({
env: "your-env-id"
});
</script>

Note:
The feature module must be introduced after the kernel, and the login module must be introduced.
The latest version number can be found on NPM.

Development Documentation

Note:
The new version of the JavaScript SDK has been renamed to @cloudbase/js-sdk. The old version tcb-js-sdk will no longer be updated in the future. For details, please refer to the migration guide.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback