Embed Your Pet

1. Unzip all the files into one folder.
2. Open install.html. Your pet should appear in a corner; hover or drag it to test.
3. Upload moss-widget.js to your website's public folder.
4. Add this before </body> (update the path if you use a different folder):

<script src="/moss-widget.js"></script>

5. Reload your live site. If the pet is missing, open the script URL directly:
   it should show JavaScript, not a 404 or an HTML page. Check the filename,
   upload folder and browser console. Your site may need to allow the script
   in its Content Security Policy. Use only one copy of the widget per page.

The script auto-mounts the pet. Advanced usage:

<script>
  window.PetWidgetOptions = {
    scale: 0.7,
    corner: 'bottom-right',
    margin: 28
  };
</script>
<script src="/moss-widget.js"></script>

Messages and replies:

<script>
  PetWidget.say('Welcome in.');
  PetWidget.trigger('cta.clicked', {
    label: 'Start',
    preset: 'greatClick',
    task: { state: 'waving', duration: 2600 },
    message: 'Great click. I saw that.'
  });
  PetWidget.setResponder(async function (action) {
    const response = await fetch('/api/pet-reply', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ action: action })
    });

    return response.json();
  });
</script>

Your pet file is embedded inside the JavaScript. EmbedYourPet does not need to host your asset.