Skip to main content

Initialization

After initializing with node-sdk, get the data model instance via .models.

import tcb from '@cloudbase/node-sdk'

// Initialize. Under Cloud Functions, secretId and secretKey can be omitted. If env is not specified, the environment ID of the current function's environment will be used.
const app = tcb.init({
secretId: 'xxxxx',
secretKey: 'xxxx',
sessionToken: 'xxxx',
env: 'xxx'
})

const models = app.models