Skip to main content

API Key Configuration

Overview

API Key is the core authentication credential for Tencent Cloud TCB, used to control resource access permissions and determine which resources can be accessed (such as HTTP APIs, Cloud Functions, Cloud Run, etc.)

Resource access can be directly performed via API Key without login authentication

API Key Types

API Key is used to authenticate resource access permissions, enabling applications to access Tencent Cloud's resource services, and is not intended for user differentiation. API Keys fall into the following two categories:

💡 Note: Can be exposed in the browser, used to request publicly accessible resources, and can effectively reduce MAU.

Using Examples

See Web SDK Initialization for details:

const app = cloudbase.init({
env: "your-env-id",
accessKey: "<publishable_key>",
});

app.callFunction({
name: "test",
});

app.models.test.get();

Publishable Key and Login Authentication

Using a Publishable Key does not mean that the default guest identity has been adopted for login. It merely employs a publicly accessible key for resource access and does not carry any user information.

In applications, you can use a Publishable Key to access Tencent Cloud resources. Users can also access resources using their personal access_token via Login Authentication. These two approaches are not mutually exclusive.

Relationship with Login Authentication