Installing Composer and composer.json inside WordPress theme

I try to install composer inside a WordPress theme.
Need help how to manage composer.json and where it should be placed to manage links inside WordPress pages.

As I understand

  1. we install composer and it is outside WordPress public_html folder.
  2. composer.JSON will be inside a root directory besides composer-LOCK
  3. create a vendor directory inside a root directory and place a file called autoload.php inside the vendor directory.
  4. we initialize components:
require_once ROOT_DIR . "vendor/autoload.php";
//use Twilio\Rest\Client;

Please inform me if this will work or PHP code need modifications?
Where (file) we place PHP code?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.