SDK Overview
Add Miso to any site with a few lines of JavaScript.
With the Miso Client JS SDK, you can add Miso-powered experiences to any website with a few lines of JavaScript. These experiences are AI answers, related-question discovery, hybrid search, and personalized search and recommendations. Everything is fully customizable: HTML, CSS, and logic.
Looking for a runnable example? Open the Live Showcase to see every component in action.
Parts of the SDK
The SDK has three parts:
| Part | What it does |
|---|---|
| API | Call the Miso API programmatically. |
| UI | Prebuilt UI elements and layouts. They render workflows such as Ask, Explore, and Hybrid Search. You can customize their HTML, CSS, and logic. |
| Progressive Markdown | Tools to display streamed Markdown as it arrives, so answers appear word by word. |
Install
As a node module
In your project directory, run:
npm install --save @miso.ai/client-sdk
Then import MisoClient from the SDK:
import MisoClient from '@miso.ai/client-sdk';
Using a script tag
<script async src="https://cdn.jsdelivr.net/npm/@miso.ai/client-sdk@latest/dist/umd/miso.min.js"></script>
The script tag loads the SDK asynchronously, so your code must wait for it. Use
the misocmd queue, which runs your function as soon as the SDK is ready:
const misocmd = window.misocmd || (window.misocmd = []);
misocmd.push(() => {
const MisoClient = window.MisoClient;
// Your code goes here.
});
Then create a client with your publishable API key:
const client = new MisoClient('YOUR_PUBLISHABLE_KEY');
Use a publishable (front-end) API key in the browser — never your secret key. See Authentication.
Quick Starts
Pick the experience you want to ship:
- Ask — Quick Start: an AI question-answering box.
- Explore — Quick Start: related questions that drive on-page engagement.
- Hybrid Search — Quick Start: one bar that blends keyword results with an AI answer.
