Developer documentation

Context Assistant documentation

Connect the ready-made WordPress plugin or integrate the assistant through SDKs and Remote Tools.

WordPress quickstartSDK guidesRemote Tools
WordPress · About 10 minutes

Connect WordPress

Install the ready-made plugin, connect your account, and test the assistant. No code is required.

01
Administrator accessPermission to install WordPress plugins
02
Context Assistant accountRegistration and a verified email
03
HTTPS site addressThe exact public URL without a page path
  1. Install the plugin

    In WordPress admin, open Plugins → Add Plugin, search for Context Assistant, then install and activate it. Its directory page: wordpress.org/plugins/context-assistant.

  2. Create your account

    Create a Context Assistant account and verify your email.

  3. Add your site

    In Context Assistant onboarding, name your assistant, choose WordPress, and enter the exact site URL, for example https://shop.example.com.

  4. Save the connection details

    Copy the API URL, Assistant ID asst_…, and secret key ca_sk_…. The key is shown only once.

  5. Connect the plugin

    Return to the WordPress wizard, paste the three values, and select Save and check connection.

  6. Configure the widget

    Choose the title, pages where it appears, and guest access, then select Save and finish.

  7. Test the result

    Open your site and ask a test question. Knowledge sync, WordPress/WooCommerce actions, and lead capture can be enabled later under Advanced settings.

Your connection is ready

The widget opens on the selected pages and answers your test question.

Open account
Other platforms

Choose an integration

For websites and applications without WordPress, choose the path that matches your stack.

React SDK

Install:

npm install @context-assistant/react

Wrap your app (or a subtree) in the provider, then drop in the widget:

import { ContextAssistantProvider, Assistant } from '@context-assistant/react';

async function getToken(): Promise<string> {
  const res = await fetch('/api/context-assistant/token', { method: 'POST' });
  const data = await res.json();
  return data.token;
}

export function App() {
  return (
    <ContextAssistantProvider apiUrl="https://api.your-domain.example" getToken={getToken}>
      <Assistant
        agent="store-consultant"
        title="Store Consultant"
        appearance={{
          variant: 'refined',
          theme: 'system',
          welcomeMessage: 'How can I help with this product?',
          starterPrompts: ['Is it in stock?', 'Compare the available options'],
          privacyUrl: '/privacy/',
        }}
      />
    </ContextAssistantProvider>
  );
}

Need custom UI instead of the built-in widget? Use useAssistant() directly — it exposes messages, status, busy, pendingAction, send(), and the confirm/cancel pair for the preview → Apply flow.

Script embed

For any site — no framework required. Install the bundle or serve it yourself, then:

import { mount } from '@context-assistant/embed-sdk';

async function getToken(): Promise<string> {
  const res = await fetch('/api/context-assistant/token', { method: 'POST' });
  const data = await res.json();
  return data.token;
}

const widget = mount({
  apiUrl: 'https://api.your-domain.example',
  getToken,
  agent: 'store-consultant',
  title: 'Store Consultant',
  appearance: {
    variant: 'refined',
    theme: 'system',
    welcomeMessage: 'How can I help with this product?',
    starterPrompts: ['Is it in stock?', 'Compare the available options'],
    privacyUrl: '/privacy/',
  },
});

widget.setContext({
  page: { type: 'product', id: 184 },
});

The returned widget exposes open(), close(), send(), setContext(), updateContext(), clearContext(), and destroy().

JavaScript SDK

The headless client underneath both SDKs above — for building your own UI from scratch:

import { ConversationSession } from '@context-assistant/js-sdk';

async function getToken(): Promise<string> {
  const res = await fetch('/api/context-assistant/token', { method: 'POST' });
  const data = await res.json();
  return data.token;
}

const session = new ConversationSession({
  apiUrl: 'https://api.your-domain.example',
  getToken,
  agent: 'store-consultant',
});

await session.send('What pairs well with this processor?', {
  onToken: (delta) => process.stdout.write(delta),
  onDone: (event) => console.log('\n[done]', event.message),
});

Remote Tools contract

Any backend can give the assistant typed actions and grounding by implementing four HTTP endpoints. Scope is passed as execution (workspaceId, externalUserId, permissions, requestId); callId identifies one specific tool call end-to-end.

Method & pathPurpose
GET {baseURL}/toolsList available tools for this execution scope
GET {baseURL}/contextGrounding context for the current user/session
POST {baseURL}/tools/previewHuman-readable preview — no side effects
POST {baseURL}/tools/executePerform the action, after confirmation

GET /tools response:

{
  "tools": [
    {
      "name": "create_task",
      "description": "Create a task in the current project",
      "verb": "create",
      "inputSchema": { "type": "object", "properties": { "title": { "type": "string" } }, "required": ["title"] }
    }
  ]
}

POST /tools/preview request:

{
  "tool": "create_task",
  "callId": "call_abc123",
  "arguments": { "title": "Ship the release" },
  "execution": {
    "workspaceId": "ws_123",
    "externalUserId": "user_42",
    "permissions": ["tasks:write"],
    "requestId": "req_xyz"
  }
}

POST /tools/preview response:

{ "preview": "Create a task “Ship the release” in Project Apollo" }

POST /tools/execute response (request is the same shape as preview):

{ "output": { "id": "task_789", "title": "Ship the release", "status": "open" } }
VerbConfirmation
getNone — auto-executed inside the turn
create, updatePreview, then explicit Apply
deletePreview, then a second, explicit confirmation

Live reference: the WordPress plugin implements this exact contract with 10 tools (6 WordPress + 4 WooCommerce), conformance-tested against a real host on every change.

Self-hosting

The core is open-core: the same Docker images we run ourselves deploy with one docker compose up, and all data — conversations, knowledge base, keys — stays in your own infrastructure. A full operator runbook is on the roadmap for this page; until then, get in touch if you want to self-host today.

Security model

The full model is on the homepage. In short: the browser only ever holds a short-lived token, every request is scoped to one tenant and workspace, the host re-checks real permissions before any action, and deletes require double confirmation with a recovery path.