These docs have been generated using AI. Expect inaccuracies until we remove this banner.
- Docs
- Developers
- Dependencies
Dependencies
If your plugin requires another plugin to function, declare it. Troy Client will prompt users to install missing dependencies before activation.
Declaring Dependencies
Single dependency:
/**
* Troy: repo.example.com
* Troy Dependency: required-library
*/
Multiple dependencies:
/**
* Troy: repo.example.com
* Troy Dependencies: library-one, library-two
*/
Dependencies from different servers:
/**
* Troy: repo.example.com
* Troy Dependencies: local-lib, external-lib <external-repo.com>
*/
Limits
- Maximum 5 dependencies per plugin
- Dependencies must also use Troy
- No version constraints (always latest)
What Users See
When someone activates your plugin without the dependencies:
- Troy Client blocks activation
- Shows which plugins are missing
- Provides install links
- After installation, activation proceeds
Keep dependencies to a minimum—each one adds friction for your users.
Best Practice
Only declare dependencies your plugin cannot function without. Optional enhancements shouldn't be dependencies.
Consider: would you rather ask your users to install three extra plugins, or bundle the 50 lines of code you actually need?
