SDK Overview

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, copy, and logic.

Looking for a runnable example? Open the Live Showcase to see every component in action.

Modules

Module What it does
Answers The flagship module. It comes in three forms. Ask is a question box. Explore puts related questions on a page. Hybrid Search joins keyword results and an answer.
Search Personalized, typo-tolerant, semantic search for your site.
Recommendation "You may also like" / trending / user-to-product recommendation units.
Elements The customizable UI building blocks (web components) shared by every module.
Plugins Optional extensions — analytics hooks, affiliation, custom workflows.

Install

You can load the SDK from a CDN or install it from npm.

Script tag (fastest)

<script
  async
  src="https://cdn.jsdelivr.net/npm/@miso.ai/client-sdk@1/dist/umd/miso.min.js"
></script>
<script>
  const misocmd = window.misocmd || (window.misocmd = []);
  misocmd.push(() => {
    const client = new window.MisoClient('YOUR_PUBLISHABLE_KEY');
  });
</script>

The script loads asynchronously, so your code has to wait for it. Push your function onto the misocmd queue, and the SDK runs it when it is ready.

@1 tracks the current 1.x release, so you get fixes automatically. To pin an exact version, replace @1 with a full version such as @1.13.1.

npm

npm install @miso.ai/client-sdk
import MisoClient from '@miso.ai/client-sdk';

const client = new MisoClient('YOUR_PUBLISHABLE_KEY');

The constructor also takes an options object, so new MisoClient({ apiKey: 'YOUR_PUBLISHABLE_KEY' }) works the same way.

Use a publishable (front-end) API key in the browser — never your secret key. See Authentication.

Choosing an integration path

There are three ways to integrate. Each one trades speed for control:

  1. Built-in UI elements — follow a Quick Start, mount a pre-built element, and customize HTML, CSS, copy, and logic. Recommended for most teams.
  2. From scratch — call the SDK API directly and render your own UI. Maximum control.
  3. Legacy combo (deprecated) — two lines of HTML, limited customization. Avoid for new builds.

Quick Starts

Pick the experience you want to ship:

How it relates to the API

The SDK is a thin wrapper over the Miso REST API. Anything the SDK does, you can also do server-side with a direct call to the API. This is useful for native apps, server rendering, or back-end pipelines.