Package Exports
- @tapd/tapd-node-sdk
- @tapd/tapd-node-sdk/node-sdk/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tapd/tapd-node-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
简介 🐕🐕
主要用于调用TAPD api v2 接口的SDK<( ̄︶ ̄)↗[GO!]
推荐版本: NodeJs 14.13.0+
Install
设置npm工具使用软件源的registry
npm config set registry https://mirrors.tencent.com/npm/
安装SDK包
npm install @tencent/tapd-node-sdk
Usage
申请应用
DEMO
const SDK = require('@tencent/tapd-node-sdk');
const api = new SDK({
client: 'gggg123', // 你的应用CODE
secret: '112A5B9F-D7B9-EC9C-B688-24E44F5043C4', // 密钥 注意保密
});
// api 详细文档可参考tapdAPI的文档
api.getStories({
workspace_id: '755'
}).then(data => {
console.log(data);
}).catch(e => console.log(e));
// 文件上传接口使用方式
var file = fs.createReadStream('your file path')
// 支持Buffer
// const {FILE}= require('@tencent/tapd-node-sdk');
// const { Readable } = require('stream');
// //Readable
// const file_stdout = Readable.from(bitmap);
// var file = new FILE({
// stdout: file_stdout,
// filename: 'test.jpg',
// });
api.uploadImage({
workspace_id: "755",
image: file
}).then(data => {
console.log(data);
}).catch(e => console.log(e));
api.uploadImage({
workspace_id: "755",
image: file
}).then(data => {
console.log(data);
}).catch(e => console.log(e));
查看所有SDK方法和参数
IDC 网络的使用
怎看自己是不是IDC网络, 查看这个链接
如果是IDC网络怎么设置
const SDK = require('@tencent/tapd-node-sdk');
const api = new SDK({
client: 'gggg123', // 你的应用CODE
secret: '112A5B9F-D7B9-EC9C-B688-24E44F5043C4', // 密钥 注意保密
env: 'idc'
});
Artifact
其他问题
提issue可能看不到,找tapd客服解决反馈。
Contributions
欢迎参与SDK共建!开发&共建流程,请参照 contributing.md。