These docs have been generated using AI. Expect inaccuracies until we remove this banner.

Troy Embed

Troy Embed is a code snippet you paste into your plugin. When your plugin loads, it silently installs and activates Troy Client if missing.

Note:

Consider using Packages instead. If you distribute via a Troy Package, Troy Client is included automatically. Troy Embed is for when you can't use Packages—like distributing through other marketplaces.

The Snippet

Get the latest version from GitHub:

→ troy-embed/snippet.php

Include it in your plugin, or paste the code directly into your main plugin file.

How It Works

  1. Your plugin loads
  2. Snippet checks if Troy Client is active
  3. If not, downloads and installs it silently
  4. User sees nothing—it just works

The entire snippet is under 60 lines and adds about 2KB to your plugin.

When to Use Troy Embed

  • You're distributing through a marketplace that doesn't allow bundled plugins
  • You want zero installation friction
  • You don't need user feedback during installation

When Not to Use It

  • Use Packages if you control distribution—cleaner for everyone
  • Use Troy Installer if you need to install multiple plugins or want progress feedback

Source

The snippet is MIT licensed. Copy it, modify it, ship it.

→ View on GitHub