Skip to content
AstrBot
Main Navigation HomeBlogRoadmapHTTP API

English

简体中文

English

简体中文

Toggle dark mode

Intro & DeployMessaging PlatformsAI IntegrationUsageDevelopment
Sidebar Navigation

Introduction

What is AstrBot

Community

FAQ

Deployment

Script Deployment

Desktop Client

One-click Launcher

Docker

Kubernetes

BT Panel

1Panel

Source Deployment

Other Deployments

CasaOS

Compshare GPU

Community-provided Deployment

Support Us

Messaging Platforms

Quick Start

QQ Official Bot

Websockets

Webhook

OneBot v11

WeCom Application

WeCom AI Bot

WeChat Official Account

Personal WeChat

Lark

DingTalk

Telegram

LINE

Slack

Mattermost

Misskey

Discord

KOOK

Satori

Connect Satori

Using server-satori

Community-provided

Matrix

VoceChat

AI Integration

✨ Model Providers

MiraRouter

NewAPI

ShengSuanYun

AIHubMix

PPIO Cloud

SiliconFlow

TokenPony

302.AI

DeepSeek TTS

DeepSeek STT

Ollama

LMStudio

⚙️ Agent Runners

Built-in Agent Runner

Dify

Coze

Alibaba Bailian

DeerFlow

Usage

WebUI

AstrBot CLI

Built-in Commands

Plugins

Plugins

MCP

Skills

AstrBot Built-in AI

Agent Sandbox

SubAgent Orchestration

Proactive Capabilities

Web Search

SerpApi

DeepSeek Search API

Knowledge Base

Context Compression

Custom Rules

Agent Execution Mode

Unified Webhook Mode

Development

Plugin Development

🌠 Getting Started

Minimal Example

Listen to Message Events

Send Messages

Plugin Configuration

Plugin Views

Overview

Standalone plugin page

Interactive message component

Workbench page

Shared Bridge API

Backend Web APIs

Plugin Internationalization

AI

Models

Agents

Tools

Sessions and Conversations

Other APIs

Storage

HTML to Image

Session Control

Publish Plugin

Plugin Market Specification

Versions

2026-11-25

2026-06-27

Platform Adapter Integration

AstrBot HTTP API

API Scope–Endpoint Reference

AstrBot Configuration File

Others

Diagnostics

Self-hosted HTML to Image

Open Source Summer

OSPP 2025

On this page

Standalone plugin page ​

Use target="plugin_page" for settings or dashboards that do not belong to a chat message. Users open the page from the WebUI plugin entry. The page reads and saves data through plugin Web APIs.

Meme Manager's standalone meme management page (Chinese UI)

Meme Manager provides a standalone page for browsing, categorizing, and managing memes. Install the plugin, then open Extensions → 表情包管理器 (Meme Manager) in the WebUI. The page reads and writes data through plugin Web APIs without creating a chat message.

Create the view files ​

Place the page assets under views/<view_name>/. AstrBot discovers views/<view_name>/index.html; directories without index.html are ignored.

Start with an existing plugin. PLUGIN_NAME must match name in its metadata.yaml.

text
astrbot_plugin_view_demo/
├─ metadata.yaml
├─ main.py
└─ views/
   ├─ bridge-demo/
   │  ├─ index.html
   │  └─ app.js
   └─ settings/
      └─ index.html

Use simple directory names for view_name, such as settings or bridge-demo. Do not use an empty name, ., .., a name starting with ., or a name containing / or \.

Users open views from the plugin detail page in the WebUI.

Undeclared directories can still be discovered as standalone pages. The default target for metadata declarations is plugin_page; this target does not use event.view_result() or declare actions.

Register the page and endpoint ​

Plugin backend code should use astrbot.api.web. Avoid exposing raw FastAPI, Starlette, or Quart request objects as the public API for your plugin business logic.

Add to metadata.yaml:

yaml
views:
  - name: bridge-demo
    target: plugin_page
    title: Bridge Demo

main.py:

python
from astrbot.api.star import Context, Star
from astrbot.api.web import json_response, request

PLUGIN_NAME = "astrbot_plugin_view_demo"


class MyPlugin(Star):
    def __init__(self, context: Context):
        super().__init__(context)
        context.register_web_api(
            f"/{PLUGIN_NAME}/ping",
            self.page_ping,
            ["GET"],
            "View ping",
        )

    async def page_ping(self):
        """Return a response for the view's ping request.

        Returns:
            JSON containing the message, limit, and authenticated username.
        """
        limit = request.query.get("limit", 20, type=int)
        return json_response(
            {
                "message": "pong",
                "limit": limit,
                "username": request.username,
            }
        )

Call the endpoint ​

views/bridge-demo/index.html

html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>Plugin View Demo</title>
  </head>
  <body>
    <button id="ping">Ping</button>
    <pre id="output"></pre>
    <script type="module" src="./app.js"></script>
  </body>
</html>

views/bridge-demo/app.js

js
const bridge = window.AstrBotPluginView;
const output = document.getElementById("output");

const context = await bridge.ready();
output.textContent = JSON.stringify(context, null, 2);

document.getElementById("ping").addEventListener("click", async () => {
  const result = await bridge.apiGet("ping", { limit: 20 });
  output.textContent = JSON.stringify(result, null, 2);
});

Reload the plugin, open bridge-demo, and click Ping. The response should contain message: "pong". The host injects the SDK automatically. See the shared Bridge API for themes and context, and backend Web APIs for routes, requests, and responses.

Edit this page on GitHub

Last updated:

Pager
PreviousOverview
NextInteractive message component

Deployed on Rainyun Logo