
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
tbox-nodejs-sdk
Advanced tools
npm install tbox-nodejs-sdk
Initialize client
import { TboxClient } from "tbox-nodejs-sdk";
const client = new TboxClient({
httpClientConfig: {
authorization: "TBox-your-token-xxx",
},
});
const emitter = client.chat({
appId: "your-app-id",
query: "今天杭州天气怎么样?",
userId: "user123",
});
emitter.on("data", (data) => {
console.log("Received data:", data);
});
emitter.on("end", () => {
console.log("Stream ended");
});
emitter.on("error", (error) => {
console.error("Stream error:", error);
});
emitter.on("abort", () => {
console.log("Stream aborted");
});
// To abort the stream
emitter.abort();
Note: After calling emitter.abort(), the stream will be immediately terminated and no further data events will be emitted. An abort event will be triggered to notify that the stream has been aborted.
const response = await client.chatSync({
appId: "your_app_id",
query: "今天杭州天气怎么样?",
userId: "user123",
});
const emitter = client.completion({
appId: "your-app-id",
inputs: { text: "苹果" },
userId: "user123",
});
emitter.on("data", (response) => {
console.log("Received completion data:", response);
});
emitter.on("end", () => {
console.log("Completion stream ended");
});
emitter.on("error", (error) => {
console.error("Error in completion:", error);
});
emitter.on("abort", () => {
console.log("Completion aborted");
});
// To abort the completion
emitter.abort();
Note: After calling emitter.abort(), the completion stream will be immediately terminated and no further data events will be emitted. An abort event will be triggered to notify that the stream has been aborted.
FAQs
## Installation
The npm package tbox-nodejs-sdk receives a total of 655 weekly downloads. As such, tbox-nodejs-sdk popularity was classified as not popular.
We found that tbox-nodejs-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.