
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
@ticos/client-sdk
Advanced tools
安装 NPM 包
npm install @ticos/client-sdk
调用 Ticos SDK 来获取相关的数据
import createTicosClient from "@ticos/client-sdk";
// 初始化 HttpClient 实例
const ticosClient = createTicosClient({ getAccessToken: async () => ACCESS_TOKEN });
// 调用相关的服务接口
// 比如:获取数字孪生数据指标
await ticosClient.getTwinMetrics(options))
通过 Ticos Hub 来监听设备数字孪生体的改变
import { createTicosHubClient } from "@ticos/client-sdk";
// 生成一个 Ticos Hub Client
const client = createTicosHubClient({
connectOnCreate: true,
productId: "H8PB01VHBE",
deviceId: "yt1",
deviceSecret: "KOzwEl+oT9hLhrQZxoRYoA==",
});
// 监听感兴趣的数据
const subscription = client.observePropsDesired({
productId: "H8PB01VHBE",
deviceId: "yt1",
}).subscribe((msg) => {
console.log("MQTT message: ", msg);
const payload = JSON.parse(msg.payload.toString());
console.log("payload: ", payload);
});
// 停止监听
subscription.unsubscribe();
// 断开连接
client.mqttClient().disconnect();
这是 Webpack 的一个已知问题,详见:Github Issues。
如果使用 ICEJS,可以创建一个 build.plugin.js,其内容如下:
module.exports = ({ context, onGetWebpackConfig }) => {
onGetWebpackConfig((config) => {
config.module
.rule("esm")
.test(/\.m?jsx?$/)
.resolve.set("fullySpecified", false);
});
};
然后在 build.json 引用这个插件:
{
"plugins": ["./build.plugin.js"]
}
更多文档请参考:Ticos 接口文档。
FAQs
Ticos client SDK for Node JS
The npm package @ticos/client-sdk receives a total of 54 weekly downloads. As such, @ticos/client-sdk popularity was classified as not popular.
We found that @ticos/client-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.