Skip to main content

Availability

AI Studio UI plugins extend the admin dashboard with custom interfaces using WebComponents. Build rich admin panels, custom dashboards, monitoring tools, and specialized management interfaces that integrate seamlessly with the AI Studio platform using the Unified Plugin SDK.
Looking for portal (end-user) pages? See the AI Portal UI Plugins Guide for building pages visible to portal users, not just admins.

Overview

UI plugins enable you to:
  • Add Custom Pages: Register new routes in the dashboard
  • Extend Sidebar: Add sections, links, and navigation
  • Serve WebComponents: Use any frontend framework (React, Vue, Lit, etc.)
  • Call Service APIs: Access LLMs, tools, datasources, analytics, and more
  • Store Plugin Data: Use built-in key-value storage
  • Define RPC Methods: Create custom backend endpoints
  • Multi-Capability: Combine UI with middleware hooks (PostAuth, Response, Object Hooks, etc.)

Unified SDK Integration

UI plugins use the Unified Plugin SDK (pkg/plugin_sdk) and can combine UI capabilities with other plugin capabilities like PostAuth, Response, or Object Hooks.

Key Features

  • BasePlugin: Convenience struct for lifecycle management
  • UIProvider: Capability for serving UI assets and RPC methods
  • Context Services: Access KV storage, logging, and Studio Services
  • Multi-Capability: Implement multiple interfaces in one plugin
  • Broker Connection: Automatic Service API access for UI interactions

Example: Multi-Capability Plugin

A single plugin can provide both UI and middleware functionality:
Expandable
Example: examples/plugins/studio/llm-rate-limiter-multiphase/ combines UIProvider + PostAuth + Response in one plugin. ##Quick Start

1. Project Structure

2. Create Manifest

server/manifest.json:
Expandable

3. Implement Plugin Server

server/main.go:
Expandable

4. Create WebComponent

ui/webc/dashboard.js:
Expandable

5. Build and Deploy

Expandable

Manifest Structure

Top-Level Fields

Permissions

Expandable

UI Configuration

Expandable

Available UI Slots

  • sidebar.section: Add sidebar section with nested items
  • sidebar.link: Add individual sidebar link
  • settings.section: Add settings page section
  • app.detail.tab: Add tab to app detail page
  • llm.detail.tab: Add tab to LLM detail page

RPC Configuration

RPC calls are automatically routed to your plugin’s HandleCall() method.

Service API Access

The Service API provides 100+ gRPC operations accessible via the SDK:

LLM Operations

Tool Operations

Plugin Operations

KV Storage Operations

App Operations

Analytics Operations

Multi-Capability Patterns

UI plugins using the unified SDK can implement multiple capabilities in a single plugin, combining dashboard UI with request/response processing, object validation, or other hooks.

Combining UI + PostAuth

Create a plugin that both displays data and processes requests:
Expandable

Combining UI + Object Hooks

Create a plugin that validates objects and provides an approval dashboard:
Expandable

Combining UI + Response

Monitor and modify responses with a dashboard:
Expandable

Benefits of Multi-Capability Plugins

  1. Unified State: Share data structures between UI and middleware
  2. Single Deployment: One plugin provides multiple features
  3. Consistent Configuration: Single manifest, config, and initialization
  4. Simplified Management: Deploy, update, and monitor as one unit
  5. Rich Dashboards: Display real-time data from middleware hooks

Working Example

See examples/plugins/studio/llm-rate-limiter-multiphase/ for a complete multi-capability plugin that implements:
  • PostAuth: Check rate limits before requests
  • Response: Update counters after responses
  • UI Provider: Dashboard showing rate limit status

Complete Example: Rate Limiting Dashboard

Here’s a complete example showing all features:

Manifest

Expandable

RPC Methods

Expandable

Frontend Frameworks

React

Expandable

Vue

Expandable

Best Practices

Security

  • Always validate inputs in RPC methods
  • Use HTTPS for production deployments
  • Sanitize HTML in WebComponents
  • Don’t expose sensitive data in frontend
  • Use CSP headers in manifest

Performance

  • Lazy-load heavy components
  • Cache frequently accessed data
  • Use KV storage for plugin state
  • Minimize Service API calls
  • Bundle and minify assets

User Experience

  • Show loading states
  • Handle errors gracefully
  • Provide feedback for actions
  • Use consistent UI patterns
  • Support dark mode if platform does

Development

  • Use TypeScript for type safety
  • Add proper error handling
  • Log important operations
  • Test with different data scenarios
  • Document RPC methods

Troubleshooting

  • Check manifest syntax (valid JSON)
  • Verify plugin_type is "ai_studio"
  • Ensure load_immediately is true in plugin registration
  • Check logs for initialization errors
  • Verify asset path is correct (leading /)
  • Check browser console for JS errors
  • Ensure custom element is defined
  • Verify mime types are correct
  • Check permission scopes in manifest
  • Verify SDK is initialized (ai_studio_sdk.IsInitialized())
  • Check context has valid authentication
  • Review service API error messages
  • Ensure assets are embedded (//go:embed)
  • Check GetAsset() normalizes paths correctly
  • Verify mime type detection
  • Check asset paths in manifest match filesystem