=== Trigli Chat Support ===
Contributors: trigli
Tags: live chat, ai chatbot, customer support, chat widget, help desk
Requires at least: 6.3
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI customer service chat for your site. Trigli answers visitors from your own docs and policies, with human handoff when the AI is unsure.

== Description ==

Trigli Chat Support adds the [Trigli](https://trigli.com) AI customer service widget to your WordPress site.

Trigli is an AI customer support platform for small businesses. You upload your policies, FAQs, and product docs to Trigli, and the chat widget answers visitor questions using only that material. When the AI is not confident, or when a visitor asks for a person, the conversation is routed to your team with in-app, email, or Microsoft Teams notifications.

**What you get**

* A floating chat bubble on your site, styled with your brand color and bot name
* AI answers grounded in the documents you provide, not generic AI guesses
* Automatic handoff to your team when confidence is low or a visitor asks for a human
* Email capture when no agent is online, so you never lose the conversation
* Visitor image uploads, chat transcripts, and proactive chat
* Widget appearance, greeting, tone, and AI behavior managed centrally in your Trigli dashboard

**How it works**

1. Create a Trigli account at [trigli.com](https://trigli.com) (a free plan is available; it includes a limited number of chats per month, see [trigli.com/pricing](https://trigli.com/pricing))
2. Upload the documents your AI should answer from
3. Install this plugin and paste your Tenant ID
4. The widget appears on your site and starts answering

The plugin itself is intentionally small. It loads the Trigli widget script on your public pages and gives you a settings page for your Tenant ID, widget position, and an optional logged-in user handoff. Everything else is configured in your Trigli dashboard, so changes there apply to your site immediately without touching WordPress.

== External Services ==

This plugin relies on Trigli (https://trigli.com), an AI customer service platform, to function. A Trigli account is required. The free tier works without payment.

Once a Tenant ID is configured in the plugin settings, the visitor's browser loads the widget script from `trigli.com` on your site's public pages and communicates with the Trigli service. While the widget is active, the following visitor data is sent to Trigli's servers (trigli.com):

* Chat messages typed by visitors, and any images they upload in the chat
* The page URL, page title, and referrer of pages the visitor views while the widget is present, used for live visitor analytics and to give the AI context about what page the visitor is on
* The visitor's IP address and browser user agent, as with any web request
* A randomly generated visitor identifier and chat session identifier, stored in the visitor's browser (localStorage) and sent with each ping, so returning visitors can resume their conversation and live visitor analytics stay consistent across pages
* If you enable the optional "Identify logged-in users" setting, the WordPress user ID, email address, and display name of logged-in visitors, used to link their chat history across devices; their name and email are also attached to the widget's page-view pings so your team can see which signed-in user is browsing which page

The plugin sends no data to Trigli and loads no remote code until a Tenant ID is configured.

Terms of Use: https://trigli.com/terms. Privacy Policy: https://trigli.com/privacy. If your site must obtain consent before loading third-party services, see the consent question in the FAQ.

== Installation ==

1. In your WordPress admin, go to Plugins, then Add New Plugin, and search for "Trigli Chat Support" (or upload the zip via Upload Plugin)
2. Install and activate the plugin
3. Go to Settings, then Trigli Chat Support
4. Paste your Tenant ID from the Trigli dashboard (open Chat, then Settings, then Embed Code) and save

If you downloaded the plugin from your Trigli dashboard, your Tenant ID is already filled in and the widget is live as soon as you activate.

== Frequently Asked Questions ==

= Do I need a Trigli account? =

Yes. The plugin is a connector for the Trigli service. You can start on the free plan at [trigli.com](https://trigli.com).

= Where do I find my Tenant ID? =

In your Trigli dashboard: open Chat, then Settings, then the Embed Code tab. If you download the plugin zip from the dashboard, the Tenant ID comes pre-configured.

= Will this slow down my site? =

The plugin adds one small script (around 10 KB compressed) that loads asynchronously, so it does not block your page render. The chat window lives in a hidden iframe, so it never affects your page layout or blocks rendering.

= I already pasted the Trigli snippet into my theme. Do I need to remove it? =

Yes, use one or the other. Remove the pasted snippet once the plugin is active, so your site does not load the widget twice.

= The widget does not appear. Why? =

Check three things: your Tenant ID is saved in Settings, then Trigli Chat Support; chat is enabled in your Trigli dashboard; and your monthly chat limit is not exhausted. The widget hides itself automatically when chat is disabled or over its limit. If you use a consent or script-blocking plugin, make sure `trigli.com` is allowed.

= What does "Identify logged-in users" do? =

When enabled, logged-in WordPress users are identified to Trigli by their user ID, email, and display name, so their chat history follows them across devices. It is off by default. Leave it off if your site serves cached pages to logged-in users, because a cached page could carry another user's identity.

= Does it work with caching plugins? =

Yes. The widget script is the same for every visitor, so page caching is fine. The one caveat is the optional logged-in user identification described above.

= How do I gate the widget behind a cookie consent banner? =

Have your consent tooling block the widget until the visitor accepts. The script handle is `trigli-chat-widget` and the script URL is `https://trigli.com/widget.js`. Developers can also suppress loading entirely with the `trigli_chat_should_enqueue` filter: return false until consent is given.

= Is my visitors' data safe? =

Chat messages and visitor analytics are processed by the Trigli service. See the External Services section above and the [Trigli privacy policy](https://trigli.com/privacy).

== Screenshots ==

1. The chat widget on a live site, answering a visitor question from the site's own documentation.
2. The plugin settings page. Paste the Tenant ID from your Trigli dashboard, choose which corner the chat bubble sits in, and optionally link chat history to logged-in WordPress users.
3. The plugin installed and active. Everything else, including widget appearance, greeting, tone, and AI behavior, is managed in your Trigli dashboard.

== Changelog ==

= 1.0.0 =
* Initial release: widget loader, settings page (Tenant ID, position, logged-in user identification), pre-configured download support

== Upgrade Notice ==

= 1.0.0 =
Initial release.
