
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
volcengine-sdk
Advanced tools
备注:JS SDK 非火山引擎官方开发,由 KrisLee 开发。
请确保您已开通了您需要访问的服务。您可前往火山引擎控制台,在左侧菜单中选择或在顶部搜索栏中搜索您需要使用的服务,进入服务控制台内完成开通流程。
Access Key(访问密钥)是访问火山引擎服务的安全凭证,包含Access Key ID(简称为AK)和Secret Access Key(简称为SK)两部分。您可登录火山引擎控制台,前往“访问控制”的“访问密钥”中创建及管理您的Access Key。更多信息可参考访问密钥帮助文档。
使用 npm 安装:
npm i volcengine-sdk
使用 <script> 标签引入:
<script type="module" src="./dist/volcengine-sdk.min.js" charset="utf-8"></script>
以文本翻译API 为例。
// import VolcEngineSDK from "volcengine-sdk";
const VolcEngineSDK = require("volcengine-sdk");
const axios = require("axios");
const { ApiInfo, ServiceInfo, Credentials, API, Request } = VolcEngineSDK;
// 设置安全凭证 AK、SK
const AK = 'AccessKey ID';
const SK = 'AccessKey Secret';
// 翻译目标语言、翻译文本列表
const toLang = 'zh';
const textList = ['Hello world', 'こんにちは世界'];
// api凭证
const credentials = new Credentials(AK, SK, 'translate', 'cn-north-1');
// 设置请求的 header、query、body
const header = new Request.Header({
'Content-Type': 'application/json'
});
const query = new Request.Query({
'Action': 'TranslateText',
'Version': '2020-06-01'
});
const body = new Request.Body({
'TargetLanguage': toLang,
'TextList': textList
});
// 设置 service、api信息
const serviceInfo = new ServiceInfo(
'open.volcengineapi.com',
header,
credentials
);
const apiInfo = new ApiInfo('POST', '/', query, body);
// 生成 API
const api = API(serviceInfo, apiInfo);
// console.log(api.url, api.params, api.config);
// 获取 API 数据,发送请求
axios.post(api.url, api.params, api.config)
.then((res) => {
console.log(res.data);
})
.catch((err) => {
console.log('err', err);
});
{
"TranslationList": [
{ "Translation": "你好,世界", "DetectedSourceLanguage": "en", "Extra": null },
{ "Translation": "你好世界", "DetectedSourceLanguage": "ja", "Extra": null }
],
"ResponseMetaData": {
"RequestId": "202210082319500102081020661C043C5F",
"Action": "TranslateText",
"Version": "2020-06-01",
"Service": "translate",
"Region": "cn-north-1"
}
}
FAQs
Volcengine SDK for JS
We found that volcengine-sdk demonstrated a not healthy version release cadence and project activity because the last version was released 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.