xalen-react
v0.1.0
Published
React hooks for the XALEN AI API. Chat completions, streaming, astrology, voice, and 200+ models.
Maintainers
Readme
xalen-react
React hooks for the XALEN AI API. Chat completions, streaming, voice astrology, and 200+ models.
Installation
npm install xalen-react xalen-sdk reactQuick Start
import { XALENProvider, useChat } from 'xalen-react';
function App() {
return (
<XALENProvider apiKey="xln_live_your_key">
<ChatWidget />
</XALENProvider>
);
}
function ChatWidget() {
const { messages, isLoading, send } = useChat({ model: 'vedika-standard' });
return (
<div>
{messages.map((m, i) => <p key={i}><b>{m.role}:</b> {m.content}</p>)}
<button onClick={() => send('What is Shakata Yoga?')} disabled={isLoading}>
Ask
</button>
</div>
);
}Hooks
| Hook | Purpose |
|------|---------|
| useChat | Multi-turn chat with message history |
| useCompletion | Single prompt completion |
| useVoice | Voice astrology (text + audio) |
| useAstrology | Birth charts, compatibility, panchang |
| useXALEN | Direct access to the XALEN client |
Documentation
Full API docs: xalen.io/docs
License
MIT
