Composer 2 requires a "only" config in composer.json, please see updated code below

Authenticating to packages.dxpr.com


  1. Ensure your composer version is 1.10 or higher
  2. In your project's composer.json file, add the DXPR composer repository:
    Example: Lightning DXPR composer.json
        "repositories": [
            {
                "type": "composer",
                "url": "https://packages.dxpr.com/8",
                "only": ["dxpr/dxpr_builder", "dxpr/dxpr_builder_e"]
            },
            {
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            },
            {
                "type": "composer",
                "url": "https://asset-packagist.org"
            }
        ],
    
  3. Get your JSON Web Token (JWT) from the downloads page

  4. Installing the token: Choose option A or B. Option B is less secure because you will expose your secret key to your composer.json file. Most systems will support option A, but if you use Pantheon's Integrated Composer system you have to use option B.
    • A: Server-wide token installation (preferred)
      Run the following command to install the token: 
      composer config --global bearer.packages.dxpr.com <token value from #3>
      OR
    • B: Composer.json custom header
      Add a custom header to the repositories section of your composer.json so that the DXPR entry looks like this: 
          "repositories": [
              {
                  "type": "composer",
                  "url": "https://packages.dxpr.com/8",
                  "only": ["dxpr/dxpr_builder", "dxpr/dxpr_builder_e"],
            "options": {
              "http": {
                "header": [
                  "Authorization: Bearer <token value from #3>"
                ]
              },
              {
                  "type": "composer",
                  "url": "https://packages.drupal.org/8"
              },
              {
                  "type": "composer",
                  "url": "https://asset-packagist.org"
              }
          ],
      
  5. You can now install DXPR Builder by running the following command:
    composer require dxpr/dxpr_builder


If you upgrade from a business subscription to an enterprise subscription you need to update your token in order to access the DXPR Builder Enterprise module. You can do this by editing the file ~/.composer/auth.json.


Note: you can also install our new Drupal installation profile with Composer. Instructions here: https://github.com/dxpr/lightning_dxpr_project

Troubleshooting

Error: Invalid credentials for 'https://packages.dxpr.com/8/p2/drupal/some_project

Then you need to update your composer.json file for Composer 2 compatibility. Composer 2 requires an additional line to the config of the DXPR package repository. Replace the following:


    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.dxpr.com/8"
        },

With the below config that contains an additional line:


    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.dxpr.com/8",
            "only": ["dxpr/dxpr_builder", "dxpr/dxpr_builder_e"]
        },


Still experiencing authentication problems against packages.dxpr.com? Try the following:

  1. If you chose option A at step 5, check that ~/.composer/auth.json contains your JSON Web token. If it doesn't repeat the steps above and make sure you are logged in with the user account that is running composer commands on your server.
  2. Validate your token by entering the following URL into the browser:
    https://dxpr.com/dxpr-web-tokens/check/<token value from #3>