SDK for building okDoc AI-powered plugins. Provides MCP-aligned types, decorators, AI format converters, and a standalone iframe SDK for creating plugins that integrate with the okDoc voice assistant.
| Type | Runtime | Best for |
|---|---|---|
| Iframe plugin | Standalone HTML page in an <iframe> |
Third-party developers, any tech stack, full isolation |
| Remote plugin | Angular web component loaded at runtime | First-party / trusted plugins, deep host integration |
Add a single <script> tag and declare your tools:
<script src="https://cdn.jsdelivr.net/gh/okDoc-ai/plugin-sdk@1.0.0/cdn/okdoc-iframe-sdk.js"></script>
<script>
const sdk = OkDocIframeSDK.create({
pluginId: 'my-plugin',
displayName: 'My Plugin',
tools: [
{
name: 'greet',
description: 'Say hello',
inputSchema: {
type: 'object',
properties: { name: { type: 'string', description: 'Name to greet' } },
required: ['name'],
},
handler: async ({ name }) => ({
content: [{ type: 'text', text: `Hello, ${name}!` }],
}),
},
],
});
</script>TypeScript support: Drop
okdoc-iframe-sdk-global.d.tsinto your project for full autocompletion.
See the full guide: DOCS/IframePluginGuide.md
npm install @okdoc-ai/plugin-sdkimport { OkDocPlugin, McpTool } from '@okdoc-ai/plugin-sdk';
@OkDocPlugin({
pluginId: 'weather',
displayName: 'Weather Plugin',
version: '1.0.0',
})
class WeatherPlugin {
@McpTool({
name: 'get_weather',
description: 'Get the current weather for a city',
inputSchema: {
type: 'object',
properties: { city: { type: 'string', description: 'City name' } },
required: ['city'],
},
})
async getWeather({ city }: { city: string }) {
return { content: [{ type: 'text', text: `Weather in ${city}: Sunny, 25°C` }] };
}
}See the full guide: DOCS/RemotePluginGuide.md
| Import path | Purpose |
|---|---|
@okdoc-ai/plugin-sdk |
Core types, decorators (@OkDocPlugin, @McpTool), metadata readers, registration |
@okdoc-ai/plugin-sdk/angular |
Angular integration (OkDocNotifier, OKDOC_NOTIFIER_TOKEN) |
@okdoc-ai/plugin-sdk/handler |
Host-side AI format converters (toGeminiFunctionDeclarations, toOpenAiFunctions) |
The standalone iframe SDK is served via jsdelivr:
https://cdn.jsdelivr.net/gh/okDoc-ai/plugin-sdk@<version>/cdn/okdoc-iframe-sdk.js
Replace <version> with a specific tag (e.g. 1.0.0) or use semver ranges (@1, @1.0).
| Guide | Description |
|---|---|
| Iframe Plugin Guide | Build iframe plugins (any tech stack, no npm) |
| Remote Plugin Guide | Build Angular remote plugins |
| Sample Remote Component Guide | Step-by-step sample remote component |
| Ionic Angular Project Setup | Host app project setup reference |
npm install
npm run build:all # TypeScript compilation + iframe SDK bundleBuild outputs:
dist/— ES module library (main SDK)dist/okdoc-iframe-sdk.js— Standalone IIFE bundle for<script>tagscdn/— jsdelivr-ready copies of the iframe SDK files
Use the interactive release script:
npm run release 1.2.0The script walks you through each step (version bump → build → commit → tag → push) with yes / skip / cancel prompts. On push, GitHub Actions creates the release automatically.
Apache License 2.0 — Copyright 2025 okDoc AI