talksilo
v1.0.1
Published
Official JavaScript SDK for the TalkSilo AI chatbot widget. Framework-agnostic, with an optional React component.
Downloads
133
Maintainers
Readme
talksilo
Official JavaScript SDK for the TalkSilo AI chatbot widget. Framework-agnostic — works with vanilla JS, Vue, Svelte, Angular, Next.js, or anything else. A React component is included as an optional export.
Under the hood the widget is a single self-contained script that renders inside an isolated Shadow DOM, so this SDK just injects it for you.
Plain HTML sites don't even need this package — just drop in the
<script async src="https://talksilo.com/widget.js" data-key="YOUR_API_KEY"></script>tag. This package is the ergonomic option for bundled apps.
Install
npm install talksiloAny JS framework (vanilla / Vue / Svelte / Angular)
import { init } from "talksilo";
init({ apiKey: "YOUR_API_KEY" });
// optional: init({ apiKey: "...", position: "bottom-left" })That's it — one call injects the widget anywhere a document exists.
Vue example
import { onMounted } from "vue";
import { init } from "talksilo";
onMounted(() => init({ apiKey: "YOUR_API_KEY" }));React
import TalkSilo from "talksilo/react";
export default function App() {
return <TalkSilo apiKey="YOUR_API_KEY" position="bottom-right" />;
}API
init(options) → HTMLScriptElement | null
| Option | Type | Default | Description |
| ----------- | --------------------------------- | -------------------------------- | ---------------------------------------- |
| apiKey | string (required) | — | Your TalkSilo API key. |
| position | "bottom-right" \| "bottom-left" | dashboard setting | Override widget position for this embed. |
| widgetUrl | string | https://talksilo.com/widget.js | Override when self-hosting. |
- Safe to call multiple times — it won't inject a duplicate for the same key.
- No-op during server-side rendering.
load(options)
Alias for init.
destroy(apiKey)
Removes a previously injected widget script.
License
MIT
