
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@nonefinity/ai-sdk
Advanced tools
AI SDK for integrating Nonefinity's powerful chat system into any website. Built with TypeScript, React, and Server-Sent Events (SSE) for real-time streaming.
Always install the latest published version to benefit from the newest browser fixes and streaming improvements.
npm install @nonefinity/ai-sdk
# or
yarn add @nonefinity/ai-sdk
# or
pnpm add @nonefinity/ai-sdk
Heads up: Version 1.0.1 includes improved SSE parsing for browsers that deliver events as strings (Safari, some Chromium builds). Upgrade if you previously saw empty assistant replies.
Check out our example implementation:
import { ChatWidget } from "@nonefinity/ai-sdk";
import "@nonefinity/ai-sdk/styles";
function App() {
return (
<ChatWidget
sessionId="your-session-id"
apiKey="your-api-key"
position="bottom-right"
primaryColor="#3b82f6"
title="AI Assistant"
placeholder="Ask me anything..."
/>
);
}
import { NonefinitySimpleClient } from "@nonefinity/ai-sdk/simple";
const client = new NonefinitySimpleClient({
chatConfigId: "your-config-id",
apiKey: "your-api-key",
// apiUrl: "https://api.nonefinity.com/api/v1", // Optional: Defaults to production
session: "auto", // auto-generate session ID
});
// Send a message with streaming
await client.chat("Hello, how can you help me?", (event) => {
if (event.event === "message" && event.data.content) {
console.log("AI:", event.data.content);
}
});
import { NonefinityClient } from "@nonefinity/ai-sdk";
const client = new NonefinityClient({
apiKey: "your-api-key",
// apiUrl: "https://api.nonefinity.com/api/v1", // Optional: Defaults to production
debug: true,
});
// Create a chat configuration
const config = await client.createConfig({
name: "My Chat Bot",
chat_model_id: "model-id",
instruction_prompt: "You are a helpful assistant.",
});
// Create a chat session
const session = await client.createSession({
chat_config_id: config.data.id,
name: "User Conversation",
});
// Stream a message
await client.streamMessage(
session.data.id,
"Hello, how can you help me?",
(event) => {
if (event.event === "ai_result") {
console.log("AI:", event.data.content);
} else if (event.event === "tool_calls") {
console.log("Tool called:", event.data.name);
}
}
);
Simplified client for basic chat functionality.
new NonefinitySimpleClient(config: SimpleClientConfig)
Config Options:
chatConfigId (string, required) - Chat configuration IDapiKey (string, required) - API key for authenticationapiUrl (string, optional) - Base URL of your Nonefinity API (defaults to production)session (string | "auto", optional) - Session ID or "auto" to generateMethods:
// Send a chat message with streaming
chat(message: string, onEvent: (event: StreamEvent) => void): Promise<void>
// Get current session ID
getSessionId(): string | null
// Clear current session
clearSession(): void
// Create a new session
createSession(): Promise<string>
Full-featured client for complete API access.
Config Options:
apiUrl (string, optional) - Base URL of your Nonefinity API (defaults to production)apiKey (string, optional) - API key for authenticationgetAuthToken (function, optional) - Function to get dynamic auth tokendebug (boolean, optional) - Enable debug loggingKey Methods:
// Chat Configuration
listConfigs(skip?: number, limit?: number): Promise<ApiResponse<ChatConfigListResponse>>
createConfig(data: ChatConfigCreate): Promise<ApiResponse<ChatConfig>>
updateConfig(id: string, data: ChatConfigUpdate): Promise<ApiResponse<ChatConfig>>
deleteConfig(id: string): Promise<ApiResponse<void>>
// Chat Sessions
listSessions(skip?: number, limit?: number): Promise<ApiResponse<ChatSessionListResponse>>
createSession(data: ChatSessionCreate): Promise<ApiResponse<ChatSession>>
deleteSession(id: string): Promise<ApiResponse<void>>
clearSessionMessages(id: string): Promise<ApiResponse<void>>
// Streaming
streamMessage(sessionId: string, message: string, onEvent: (event: StreamEvent) => void): Promise<void>
Props:
interface WidgetConfig {
sessionId: string; // Required - Chat session ID
apiUrl?: string; // Optional - API base URL (defaults to production)
apiKey?: string; // Optional - API key
getAuthToken?: () => Promise<string | null> | string | null; // Optional - Auth token function
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left"; // Default: "bottom-right"
primaryColor?: string; // Default: "#3b82f6"
title?: string; // Default: "AI Assistant"
placeholder?: string; // Default: "Type your message..."
className?: string; // Optional - Additional CSS classes
style?: React.CSSProperties; // Optional - Inline styles
onError?: (error: Error) => void; // Optional - Error callback
}
The SDK emits the following events during streaming:
| Event | Description | Data |
|---|---|---|
start | Stream started | {} |
tool_calls | AI is calling a tool | { name, arguments, id? } |
tool_result | Tool execution completed | { name, result, id? } |
ai_result | AI response content | { role, content, is_delta? } |
error | Error occurred | { message, status_code? } |
message | Generic message (includes done) | { done?: boolean } |
Full TypeScript definitions included:
import type {
ChatConfig,
ChatSession,
ChatMessage,
StreamEvent,
NonefinityConfig,
SimpleClientConfig,
} from "@nonefinity/ai-sdk";
MIT © Nonefinity
For issues and questions, please visit:
FAQs
AI SDK for integrating Nonefinity chat system into any website
We found that @nonefinity/ai-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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.