@tryportal/widget
v0.1.0
Published
The Portal support widget: an AI agent that answers first, a team inbox behind it, one component or one mount call on your site.
Maintainers
Readme
@tryportal/widget
The Portal support widget. A launcher in the corner of your site opens into a support panel: an AI agent answers first, your team picks up in the Portal inbox, and replies stream back to the visitor. You manage no state, connection, or message list.
Install
npm install @tryportal/widgetImport the stylesheet once, wherever your global CSS lives:
import "@tryportal/widget/styles.css";React
import { PortalSupport } from "@tryportal/widget";
<PortalSupport apiKey="portal_pk_..." />;Mount it once, anywhere in your tree. The portal_pk_ id is derived from
your server's PORTAL_KEY; the docs show the one line helper.
Without React
import { mountPortalSupport } from "@tryportal/widget";
const support = mountPortalSupport({ apiKey: "portal_pk_..." });Same widget, same options, on any page with a bundler. The instance returns
update for new options and unmount to take it off the page. React
installs alongside as a peer dependency; your app does not use it.
Control it from anywhere
import { portalSupport } from "@tryportal/widget";
portalSupport.open();
portalSupport.attach("Crash trace", error.stack);
portalSupport.reset(); // on sign outReact components can use usePortalSupport() for the same control with a
live isOpen.
Theming
The widget reads shadcn-style CSS variables from your page and falls back to a plain light theme without them. It inherits your font.
Docs
Prop reference, identity verification, diagnostics, agent tools: tryportal.app, or the source at github.com/tryportal/portal.
