
外掛標籤
開發者團隊
原文外掛簡介
Legion AI Connect adds an AI chat assistant to a WordPress website. Site owners configure a Legion Client ID, and visitors choose Connect to AI before chatting. Visitors fund their own model usage; site owners keep their configured owner margin.
Legion AI Connect requires the external Legion AI service to provide authorization, usage billing, and AI model responses. See the External Services section for complete data-flow and policy disclosures.
How it works:
Install the plugin and configure a Legion Client ID.
Add the chat using the block editor, Elementor, or the [legion_chat] shortcode.
A visitor chooses Connect to AI and authorizes the site through Legion.
The visitor’s messages are processed by Legion, and the site owner keeps the app’s configured owner margin.
Features:
Gutenberg block named Legion AI Chat
Elementor widget when Elementor is installed
[legion_chat] shortcode
Compact article-button and inline display modes
Configurable greeting, accent color, position, and theme
Per-widget context IDs and inline pasted context for article-specific chats
Animated thinking indicator while responses are loading
Safe Markdown formatting for assistant responses
Visitor-funded usage without a site-wide AI provider key
Local plugin assets with no third-party JavaScript CDN
Requirements:
A Legion developer account and app Client ID
WordPress 6.3 or later
PHP 7.4 or later
External Services
This plugin depends on Legion AI, a service operated by Legion, to authenticate visitors, maintain usage billing, route requests to AI model providers, calculate usage, and return AI-generated responses. The plugin does not provide AI responses without this service.
The visitor’s browser contacts the following Legion endpoints only after the site owner has configured a Client ID and the visitor chooses to connect or use the chat:
https://legion-ai.org/connect for the interactive OAuth authorization page.
https://auth.legion-ai.org for OAuth token exchange and token refresh.
https://api.legion-ai.org for AI chat requests.
Data sent can include the Legion Client ID, OAuth authorization code, access and refresh tokens, visitor chat messages, optional inline widget context, selected context IDs, selected model options, and technical request metadata required to secure, process, meter, and bill the request. Legion may use third-party AI model and infrastructure providers to fulfill requests as described in its policies.
Legion AI service
Legion Terms of Service
Legion Privacy Policy
Privacy
This plugin does not store visitor chat messages or Legion tokens in the WordPress database. Inline widget context is scoped to the rendered widget and is not added to persistent Legion knowledge by this plugin. Access and refresh tokens are stored in the visitor’s browser local storage. Temporary OAuth state, pending draft text during reauthorization, and authorization codes are stored in browser session storage.
Site owners should review Legion’s policies and update their own privacy notice as appropriate for their jurisdiction and use of the service.
Source Code
The plugin package includes the human-readable source code, license, package manifest, and Vite build configuration for the bundled Legion JavaScript SDK under source/legion-sdk/. The minified runtime file built from that source is assets/legion-sdk.min.js.
To rebuild the SDK from the plugin directory, install Node.js 20 or later and run:
cd source/legion-sdk && npm install && npm run build
The rebuilt browser bundle is written to source/legion-sdk/dist/legion-sdk.min.js and can be compared with assets/legion-sdk.min.js.
