{"id":329789,"date":"2026-06-29T18:40:23","date_gmt":"2026-06-29T18:40:23","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/legion-ai-connect\/"},"modified":"2026-07-05T12:21:44","modified_gmt":"2026-07-05T12:21:44","slug":"legion-ai-connect","status":"publish","type":"plugin","link":"https:\/\/kn.wordpress.org\/plugins\/legion-ai-connect\/","author":23520027,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.8","stable_tag":"trunk","tested":"7.0","requires":"6.3","requires_php":"7.4","requires_plugins":null,"header_name":"Legion AI Connect","header_author":"Legion AI","header_description":"Add AI-powered chat to WordPress with visitor-funded usage and configurable owner earnings.","assets_banners_color":"ffffff","last_updated":"2026-07-05 12:21:44","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/legion-ai.org\/wordpress","header_author_uri":"https:\/\/legion-ai.org","rating":0,"author_block_rating":0,"active_installs":0,"downloads":103,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.5":{"tag":"1.0.5","author":"legionai","date":"2026-06-29 18:39:47"},"wordpress-v1.0.6":{"tag":"wordpress-v1.0.6","author":"legionai","date":"2026-07-04 20:03:57"},"wordpress-v1.0.7":{"tag":"wordpress-v1.0.7","author":"legionai","date":"2026-07-05 04:51:10"},"wordpress-v1.0.8":{"tag":"wordpress-v1.0.8","author":"legionai","date":"2026-07-05 12:21:44"}},"upgrade_notice":{"1.0.8":"<p>Shows Connect to AI before visitors type and preserves drafts during reauthorization.<\/p>","1.0.7":"<p>Adds enclosed shortcode context for longer pasted article text and quotation marks.<\/p>"},"ratings":[],"assets_icons":{"icon-256x256.png":{"filename":"icon-256x256.png","revision":3596182,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3596182,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3596182,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":{"legion-ai\/chat":{"$schema":"https:\/\/schemas.wp.org\/trunk\/block.json","apiVersion":3,"name":"legion-ai\/chat","version":"1.0.8","title":"Legion AI Chat","category":"widgets","icon":"format-chat","description":"Add an AI-powered chat widget to your page.","textdomain":"legion-ai-connect","supports":{"multiple":false,"html":false},"attributes":{"position":{"type":"string","default":""},"theme":{"type":"string","default":""},"placeholder":{"type":"string","default":""},"greeting":{"type":"string","default":""},"accent_color":{"type":"string","default":""},"trigger_text":{"type":"string","default":""},"context_ids":{"type":"string","default":""},"context_text":{"type":"string","default":""},"context_label":{"type":"string","default":""}},"editorScript":"file:.\/editor.js"}},"tagged_versions":["1.0.5","wordpress-v1.0.6","wordpress-v1.0.7","wordpress-v1.0.8"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3596182,"resolution":"1","location":"assets","locale":"","width":559,"height":593},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3596182,"resolution":"2","location":"assets","locale":"","width":461,"height":568},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3596182,"resolution":"3","location":"assets","locale":"","width":493,"height":746},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3596182,"resolution":"4","location":"assets","locale":"","width":962,"height":798}},"screenshots":{"1":"Chat widget in dark mode.","2":"Chat widget in light mode.","3":"Admin settings page with appearance options.","4":"Gutenberg block editor controls."}},"plugin_section":[],"plugin_tags":[2353,5739,14160,2364,377],"plugin_category":[35],"plugin_contributors":[269505],"plugin_business_model":[],"class_list":["post-329789","plugin","type-plugin","status-publish","hentry","plugin_tags-ai","plugin_tags-artificial-intelligence","plugin_tags-chat-widget","plugin_tags-chatbot","plugin_tags-monetization","plugin_category-advertising","plugin_contributors-legionai","plugin_committers-legionai"],"banners":{"banner":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/banner-772x250.png?rev=3596182","banner_2x":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/banner-1544x500.png?rev=3596182","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/icon-256x256.png?rev=3596182","icon_2x":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/icon-256x256.png?rev=3596182","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/screenshot-1.png?rev=3596182","caption":"Chat widget in dark mode."},{"src":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/screenshot-2.png?rev=3596182","caption":"Chat widget in light mode."},{"src":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/screenshot-3.png?rev=3596182","caption":"Admin settings page with appearance options."},{"src":"https:\/\/ps.w.org\/legion-ai-connect\/assets\/screenshot-4.png?rev=3596182","caption":"Gutenberg block editor controls."}],"raw_content":"<!--section=description-->\n<p>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.<\/p>\n\n<p>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.<\/p>\n\n<p><strong>How it works:<\/strong><\/p>\n\n<ol>\n<li>Install the plugin and configure a Legion Client ID.<\/li>\n<li>Add the chat using the block editor, Elementor, or the <code>[legion_chat]<\/code> shortcode.<\/li>\n<li>A visitor chooses Connect to AI and authorizes the site through Legion.<\/li>\n<li>The visitor's messages are processed by Legion, and the site owner keeps the app's configured owner margin.<\/li>\n<\/ol>\n\n<p><strong>Features:<\/strong><\/p>\n\n<ul>\n<li>Gutenberg block named Legion AI Chat<\/li>\n<li>Elementor widget when Elementor is installed<\/li>\n<li><code>[legion_chat]<\/code> shortcode<\/li>\n<li>Compact article-button and inline display modes<\/li>\n<li>Configurable greeting, accent color, position, and theme<\/li>\n<li>Per-widget context IDs and inline pasted context for article-specific chats<\/li>\n<li>Animated thinking indicator while responses are loading<\/li>\n<li>Safe Markdown formatting for assistant responses<\/li>\n<li>Visitor-funded usage without a site-wide AI provider key<\/li>\n<li>Local plugin assets with no third-party JavaScript CDN<\/li>\n<\/ul>\n\n<p><strong>Requirements:<\/strong><\/p>\n\n<ul>\n<li>A Legion developer account and app Client ID<\/li>\n<li>WordPress 6.3 or later<\/li>\n<li>PHP 7.4 or later<\/li>\n<\/ul>\n\n<h3>External Services<\/h3>\n\n<p>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.<\/p>\n\n<p>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:<\/p>\n\n<ul>\n<li><code>https:\/\/legion-ai.org\/connect<\/code> for the interactive OAuth authorization page.<\/li>\n<li><code>https:\/\/auth.legion-ai.org<\/code> for OAuth token exchange and token refresh.<\/li>\n<li><code>https:\/\/api.legion-ai.org<\/code> for AI chat requests.<\/li>\n<\/ul>\n\n<p>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.<\/p>\n\n<ul>\n<li><a href=\"https:\/\/legion-ai.org\">Legion AI service<\/a><\/li>\n<li><a href=\"https:\/\/legion-ai.org\/terms\">Legion Terms of Service<\/a><\/li>\n<li><a href=\"https:\/\/legion-ai.org\/privacy\">Legion Privacy Policy<\/a><\/li>\n<\/ul>\n\n<h3>Privacy<\/h3>\n\n<p>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.<\/p>\n\n<p>Site owners should review Legion's policies and update their own privacy notice as appropriate for their jurisdiction and use of the service.<\/p>\n\n<h3>Source Code<\/h3>\n\n<p>The plugin package includes the human-readable source code, license, package manifest, and Vite build configuration for the bundled Legion JavaScript SDK under <code>source\/legion-sdk\/<\/code>. The minified runtime file built from that source is <code>assets\/legion-sdk.min.js<\/code>.<\/p>\n\n<p>To rebuild the SDK from the plugin directory, install Node.js 20 or later and run:<\/p>\n\n<pre><code>cd source\/legion-sdk &amp;&amp; npm install &amp;&amp; npm run build\n<\/code><\/pre>\n\n<p>The rebuilt browser bundle is written to <code>source\/legion-sdk\/dist\/legion-sdk.min.js<\/code> and can be compared with <code>assets\/legion-sdk.min.js<\/code>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install Legion AI Connect from Plugins &gt; Add New, or upload the plugin ZIP.<\/li>\n<li>Activate the plugin.<\/li>\n<li>Open Settings &gt; Legion AI.<\/li>\n<li>Create a WordPress app in the <a href=\"https:\/\/legion-ai.org\/developer\">Legion Developer Dashboard<\/a>.<\/li>\n<li>Add the Redirect URI shown on the settings page to the Legion app.<\/li>\n<li>Paste the app Client ID into the plugin settings and save.<\/li>\n<li>Add the Legion AI Chat block, Elementor widget, or <code>[legion_chat]<\/code> shortcode to a page.<\/li>\n<\/ol>\n\n<p>Article-button example:<\/p>\n\n<pre><code>[legion_chat position=\"button\" trigger_text=\"Chat with this article\"]\n<\/code><\/pre>\n\n<p>Inline example:<\/p>\n\n<pre><code>[legion_chat position=\"inline\" theme=\"light\"]\n<\/code><\/pre>\n\n<p>Article-specific context example:<\/p>\n\n<pre><code>[legion_chat position=\"inline\" context_ids=\"ctx_abc123\" context_text=\"Paste article context here\"]\n<\/code><\/pre>\n\n<p>For longer pasted context or text containing quotation marks, put the context between opening and closing shortcode tags:<\/p>\n\n<pre><code>[legion_chat position=\"inline\"]Paste article context here[\/legion_chat]\n<\/code><\/pre>\n\n<!--section=faq-->\n<dl>\n<dt id=\"do%20i%20need%20an%20ai%20provider%20api%20key%3F\"><h3>Do I need an AI provider API key?<\/h3><\/dt>\n<dd><p>No. This plugin uses the Legion AI service. You need a Legion developer account and Client ID. Visitors authorize through Legion and fund their usage.<\/p><\/dd>\n<dt id=\"how%20do%20site-owner%20earnings%20work%3F\"><h3>How do site-owner earnings work?<\/h3><\/dt>\n<dd><p>The app owner configures an owner margin in the Legion dashboard and keeps that owner margin on eligible usage. Payout setup and current transaction details are available in the Legion dashboard.<\/p><\/dd>\n<dt id=\"what%20data%20leaves%20my%20wordpress%20site%3F\"><h3>What data leaves my WordPress site?<\/h3><\/dt>\n<dd><p>Only after a visitor chooses Connect to AI, the visitor's browser contacts Legion for authorization. Chat messages, optional inline widget context, selected context IDs, authorization tokens, the configured Client ID, and request metadata are then sent from the visitor's browser to Legion to provide and bill the requested AI response. No chat transcript is stored in the WordPress database by this plugin.<\/p><\/dd>\n<dt id=\"where%20are%20visitor%20tokens%20stored%3F\"><h3>Where are visitor tokens stored?<\/h3><\/dt>\n<dd><p>Legion access and refresh tokens are stored in that visitor's browser local storage. OAuth state and temporary authorization codes are stored in browser session storage.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20gutenberg%3F\"><h3>Does it work with Gutenberg?<\/h3><\/dt>\n<dd><p>Yes. Search for Legion AI Chat in the block editor.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20elementor%3F\"><h3>Does it work with Elementor?<\/h3><\/dt>\n<dd><p>Yes. When Elementor is active, Legion AI Chat appears in the Elementor widget panel.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.8<\/h4>\n\n<ul>\n<li>Replaced the disconnected chat composer with a Connect to AI button before visitors can type.<\/li>\n<li>Preserved pending draft text if a stale saved token requires reauthorization.<\/li>\n<li>Removed legacy billing wording from WordPress visitor-facing prompts.<\/li>\n<\/ul>\n\n<h4>1.0.7<\/h4>\n\n<ul>\n<li>Added enclosed shortcode context so long pasted article text and quotation marks work reliably.<\/li>\n<\/ul>\n\n<h4>1.0.6<\/h4>\n\n<ul>\n<li>Added per-widget context IDs for filtering app knowledge on a specific chat.<\/li>\n<li>Added inline pasted context for article-specific chats without adding it to persistent Legion knowledge.<\/li>\n<li>Added Gutenberg and Elementor controls for per-widget context.<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Added explicit same-tab approval when an app needs a higher monthly spending cap.<\/li>\n<li>Added same-tab payment-method setup and automatic return to the originating chat.<\/li>\n<li>Kept expired and revoked sessions on the normal reauthorization flow.<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Added an animated three-dot thinking indicator while AI responses are loading.<\/li>\n<li>Added safe Markdown formatting for assistant responses, including emphasis, links, lists, quotes, and code blocks.<\/li>\n<li>Added PKCE protection to OAuth authorization and code exchange.<\/li>\n<li>Added silent access-token refresh without requiring visitors to sign in again.<\/li>\n<li>Added automatic same-tab reauthorization and return when a saved connection has been revoked.<\/li>\n<li>Changed all visitor authorization to same-tab authorization and added PKCE support for browsers without Web Crypto digest APIs.<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Replaced invalid project links with the public Legion WordPress resource page.<\/li>\n<li>Documented and bundled human-readable SDK source and build configuration.<\/li>\n<li>Loaded OAuth callback styles through the WordPress enqueue API.<\/li>\n<li>Added server-side WordPress nonce verification to the existing OAuth state checks.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Load chat assets only on pages that use the Legion widget.<\/li>\n<li>Improved OAuth callback compatibility with WordPress script handling.<\/li>\n<li>Added WordPress 7.0 block editor compatibility.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Fixed authorization on sites that use plain permalinks.<\/li>\n<li>Strengthened OAuth state generation in the bundled browser SDK.<\/li>\n<li>Fixed the default chat model when an app has no saved model selection.<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial WordPress.org release.<\/li>\n<li>Added Gutenberg, Elementor, shortcode, and article-button integrations.<\/li>\n<li>Added configurable position, theme, greeting, and accent color.<\/li>\n<li>Added OAuth state and callback-origin validation.<\/li>\n<\/ul>","raw_excerpt":"Add visitor-funded AI chat to WordPress and keep your configured owner margin on usage.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/329789","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=329789"}],"author":[{"embeddable":true,"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/legionai"}],"wp:attachment":[{"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=329789"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=329789"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=329789"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=329789"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=329789"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/kn.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=329789"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}