Skip to main content
Once your agent is configured and published, embed it on your website with a single script tag.

Embed code

Copy the snippet from your agent’s Deploy tab and paste it before the closing </body> tag:
<script
  src="https://app.psquared.dev/widget.js"
  data-config='{"agentId": "your-agent-id"}'
  async
></script>
The widget loads asynchronously and won’t block your page.

Platform guides

Add the embed snippet to your theme’s footer.php or use a plugin like Insert Headers and Footers to add it site-wide.
Go to Project Settings > Custom Code > Footer Code and paste the snippet.
Use the Embed HTML element or add custom code via Settings > Custom Code.
Go to Online Store > Themes > Edit code and add the snippet to theme.liquid before </body>.
Paste the snippet directly in your HTML file before </body>.

Publish workflow

Your widget only serves the published version of your agent. Draft changes are not visible to visitors until you click Publish.
  1. Make changes to your agent (prompt, knowledge, widget style)
  2. Test in the Playground
  3. Click Publish to push changes live