
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.
A ~3 kB, zero-dependency wrapper that lets any web or Node app talk to an
OpenAI-compatible relay (for example https://ucai.ngrok.app/api/v1).
It supports everything in the modern spec:
dall-e-2/3, gpt-image-1)…and ships helpers so you never hand-craft request JSON again.
npm i ucai-sdk # or drop dist/ucai.iife.js in a <script>
import { UCAI } from 'ucai-sdk/dist/ucai.esm.js';
const ai = new UCAI({
baseUrl: 'https://ucai.ngrok.app/api/v1',
apiKey : 'sk-YOUR-KEY',
});
<script type="module">
import { UCAI } from 'https://cdn.jsdelivr.net/npm/ucai-sdk@0.1.0/dist/ucai.esm.js';
const ai = new UCAI({ baseUrl:'…', apiKey:'…' });
</script>
<script src="https://cdn.jsdelivr.net/npm/ucai-sdk@0.1.0/dist/ucai.iife.js"></script>
<script>
const ai = new UCAI.UCAI({ baseUrl:'…', apiKey:'…' });
</script>
const res = await ai.chat({
messages: [{ role:'user', content:'Summarise tokenisation in one line' }],
});
console.log(res.choices[0].message.content);
const { stream } = await ai.chat({
stream: true,
messages: [{ role:'user', content:'Write a haiku about code' }],
});
for await (const chunk of stream) {
process.stdout.write(chunk.choices?.[0]?.delta?.content || '');
}
const { stream, controller } = await ai.chat({ …, stream:true });
setTimeout(() => controller.abort(), 2000);
const tools = [
{
schema: {
name: 'getPi',
description: 'Returns π with given decimals',
parameters: {
type: 'object',
properties: { d: { type:'integer', minimum:1, maximum:10 } },
required: ['d'],
},
},
func: ({ d }) => +Math.PI.toFixed(d),
},
];
const out = await ai.chat({
messages: [
{ role:'system', content:'You can call getPi' },
{ role:'user', content:'Give me pi with 5 decimals' },
],
tools,
});
console.log(out.choices[0].message.content);
const schema = {
name: 'projectIdea',
strict: true,
schema: {
type: 'object',
properties: {
idea: { type:'string' },
difficulty: { type:'integer', minimum:1, maximum:10 },
},
required: ['idea','difficulty'],
},
};
const out = await ai.chat({
messages: [{ role:'user', content:'Side-project idea in JSON' }],
schema,
validateSchema: true, // optional runtime AJV check
});
console.log(out.parsed); // already JSON.parse’d
import { PLUGIN } from 'ucai-sdk/dist/ucai.esm.js';
const news = await ai.chat({
messages: [{ role:'user', content:'Latest news on Google I/O 2025?' }],
plugins : [PLUGIN.web], // web-search plugin
});
console.log(news.choices[0].message.content);
Combine freely:
plugins : [PLUGIN.web, PLUGIN.pdf('mistral-ocr')]
('pdf-text' is the free default engine; 'mistral-ocr' handles scanned docs.)
import {
attachImageUrl,
attachPDFBlob,
} from 'ucai-sdk/dist/ucai.esm.js';
/* image url */
await ai.chat({
messages: [{
role:'user',
content:[
{ type:'text', text:"What's in this image?" },
attachImageUrl('https://example.com/photo.jpg'),
],
}],
});
/* PDF blob (e.g. <input type=file>) */
const pdfPart = await attachPDFBlob(fileInput.files[0]);
await ai.chat({
messages:[{ role:'user', content:'Summarise this PDF' }],
files:[pdfPart],
plugins:[PLUGIN.pdf()], // use OCR engine if needed
});
dall-e-2/3)const res = await ai.generateImage({
prompt: 'Singapore skyline in synth-wave style',
model : 'openai/dall-e-3',
size : '1024x1024',
});
document.getElementById('out').src = res.data[0].url; // expires in 60 min
gpt-image-1)const res = await ai.generateImage({
prompt: 'Cute corgi in space suit',
model : 'gpt-image-1',
response_format: 'b64_json', // default for this model
});
const img = new Image();
img.src = `data:image/png;base64,${res.data[0].b64_json}`;
document.body.append(img);
| Helper | Purpose |
|---|---|
attachImageUrl(url) | Image by public URL |
attachImageBlob(blob) | Local file/Blob image |
attachPDFBlob(blob) | Local PDF attachment |
toDataURL(buf,mime) | Low-level base-64 utility |
PLUGIN.web / PLUGIN.pdf(engine) | Plugin presets |
compressSchema(schema) | Minify JSON-schema before sending |
validateAgainst(schema,obj) | Runtime AJV validation (async) |
npm i # installs esbuild (dev dep)
npm run build # → dist/ucai.esm.js & ucai.iife.js
Drop ucai.iife.js into any legacy HTML page:
<script src="ucai.iife.js"></script>
<script>
const ai = new UCAI.UCAI({ baseUrl:'https://…', apiKey:'sk-…' });
ai.chat({ messages:[{role:'user', content:'hi'}] }).then(console.log);
</script>
demo/demo.js exercises every feature—non-stream, streaming, tools, schema,
plugins, multimodal, and image generation.
node demo/demo.js # needs Node ≥ 18 for global fetch
Enjoy the speed boost—one import, all modern OpenAI goodies.
FAQs
JavaScript SDK for UCAI API
We found that ucai-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
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.