# 应用初始化

参数

字段 类型 必填 说明
secretId string 腾讯云 API 固定密钥对,在云函数内执行可不填。前往获取 (opens new window)
secretKey string 同上
env string TCB 环境 ID,不填使用默认环境
proxy string 调用接口时使用的 http 代理 url
timeout double 调用接口的超时时间(s),默认为 15,即 15 秒
// 初始化示例
use TencentCloudBase\TCB;

// 初始化资源
// 云函数下不需要secretId和secretKey。
// env如果不指定将使用默认环境
$tcb = new Tcb([
  'secretId'=> "xxxxx",
  'secretKey'=> "xxxx",
  'env'=> "xxx"
]);

//云函数下使用默认环境
$tcb = new Tcb([]);

//云函数下指定环境
$tcb = new Tcb(['env'=> "xxx"]);

//修改请求超时时间
$tcb = new Tcb(['timeout'=> 5]);