A Composer plugin to load WordPress themes and plugins from Envato.
:bulb: Always the latest version is installed, as Envato does not make other versions available. Package version locking can only be achieved by local persistent cache, not across hosts or users.
This Composer plugin adds a virtual package repository.
It is recommended to install it globally:
composer global require --update-no-dev szepeviktor/composer-envato
It can also be installed per-project:
composer require --update-no-dev szepeviktor/composer-envato
Add all your Envato products as "packages" in either the local composer.json
file or the global config.json
file (located in $COMPOSER_HOME
).
You can find the item-id
at the end of product URL-s.
e.g. https://themeforest.net/item/avada-responsive-multipurpose-theme/2833226
{
"config": {
"envato": {
"token": "YOUR ENVATO PERSONAL TOKEN FROM https://build.envato.com/create-token",
"packages": {
"envato/avada-theme": {
"item-id": 2833226,
"type": "wordpress-theme"
},
"envato/layerslider-plugin": {
"item-id": 1362246,
"type": "wordpress-plugin"
}
}
}
}
}
:bulb: Please use the vendor name envato
for consistency.
The personal token can also be read from an environment variable or a .env
file.
Create a .env
file, where the composer.json
file lives, and add the following:
ENVATO_TOKEN="<YOUR ENVATO PERSONAL TOKEN FROM https://build.envato.com/create-token>"
Once the plugin is installed and configured, you can simply install any of the listed products as Composer packages.
:bulb: Envato API has dynamic rate limiting
activate
method it creates an ArrayRepository
with package data from config.json
v1.2
1.2.0.0