
Security News
upm Launches as a Fast, Tiny Package Manager Written in TypeScript
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.
@ticos/realtime-api
Advanced tools
Official WebSocket-based Realtime API SDK for Ticos. This SDK provides real-time communication capabilities for building interactive AI applications.
The fastest way to see the SDK in action is to run the demo project:
# Clone the repository
git clone https://github.com/tiwater/ticos-realtime-api.git
cd ticos-realtime-api
# Install dependencies
pnpm install
# Build the SDK
pnpm build
# Navigate to the demo project
cd examples/realtime-chat
# Install demo dependencies
pnpm install
# Create a .env.local file with your API key
echo "NEXT_PUBLIC_TICOS_API_KEY=your_api_key_here" > .env.local
echo "NEXT_PUBLIC_TICOS_API_URL=wss://stardust.ticos.cn/realtime" >> .env.local
# Start the demo
pnpm dev
Then open http://localhost:3000 with your browser to see the chat demo in action.
To use the SDK in your own project:
# Using pnpm (recommended)
pnpm add @ticos/realtime-api
# Using npm
npm install @ticos/realtime-api
# Using yarn
yarn add @ticos/realtime-api
import { RealtimeClient } from '@ticos/realtime-api';
// Initialize the client
const client = new RealtimeClient();
// Connect to the Ticos Realtime API
await client.connect();
// Send a message
client.sendUserMessageContent([{ type: 'text', text: 'Hello, Ticos!' }]);
// Listen for responses
client.on('conversation.updated', (event) => {
if (event.item.role === 'assistant') {
console.log('Assistant response:', event.item.formatted.text);
}
});
// Wait for a completed message
const { item } = await client.waitForNextCompletedItem();
console.log('Completed response:', item);
API documentation is automatically generated using TypeDoc. To generate the documentation, run:
pnpm docs:generate
This will generate HTML documentation in the docs directory.
To convert the TypeDoc HTML documentation to Nextra-compatible Markdown format:
pnpm docs:convert
To generate documentation and convert it to Nextra format in one step:
pnpm docs:nextra
To serve the generated documentation locally:
pnpm docs:serve
The Ticos Realtime API enables real-time bidirectional communication between your application and Ticos AI models through WebSockets.
Register custom tools that can be called by the AI:
// Register a tool
client.registerTool(
{
name: 'search',
description: 'Search for information',
parameters: {
type: 'object',
properties: {
query: { type: 'string', description: 'Search query' },
},
required: ['query'],
},
},
async (parameters) => {
// Tool implementation
const result = await yourSearchImplementation(parameters.query);
return result;
}
);
// Tools are automatically called when the model invokes them
// Listen for completed items to see if a tool was executed
client.on('conversation.item.completed', (event) => {
console.log('Item completed:', event.item);
});
Send and receive audio messages:
// Send audio
const audioBuffer = new Int16Array([
/* your audio data */
]);
client.sendUserMessageContent([{ type: 'audio', audio: audioBuffer }]);
// Or stream audio input
client.appendInputAudio(audioBuffer);
client.createResponse();
// Listen for audio responses
client.on('conversation.updated', (event) => {
if (event.item.formatted?.audio) {
const audioData = event.item.formatted.audio;
// Process audio data
}
});
# Install dependencies
pnpm install
# Build the package
pnpm build
# Run tests
pnpm test
# Generate documentation
pnpm documentation
# Start development mode with watch
pnpm dev
MIT
FAQs
Official SDK for Ticos Realtime API
The npm package @ticos/realtime-api receives a total of 0 weekly downloads. As such, @ticos/realtime-api popularity was classified as not popular.
We found that @ticos/realtime-api 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.

Security News
upm uses Node.js to deliver fast npm installs in about 250 KB, with a JavaScript API and security defaults.

Company News
Socket is joining the OpenJS Security Stewardship Program to fund Node.js vulnerability research, maintainer remediation, and security releases.

Security News
Two compromised GitHub Actions were re-enabled with malicious tags intact, exposing thousands of downstream repositories to Mini Shai-Hulud.