JetBrains Space Help

Get Composer Packages

The typical way of getting a Composer package is referencing it using the composer tool.

  1. Open the root directory of the project where you want to add a package reference. Note that the project must have the composer.json file.

  2. Configure connection to the Composer repository. For example:

    composer config repositories.mycomposerrepo composer https://composer.pkg.jetbrains.space/mycompany/p/projectKey/mycomposerrepo
  3. Optionally, if you want composer to look for packages only in Space Composer repository, you can disable the Packagist repository:

    composer config repositories.packagist.org false
  4. Generate a personal token.

  5. Provide composer the token and your Space username. For example:

    composer config --global --auth http-basic.composer.pkg.jetbrains.space username here-goes-token
  6. In Space, open Packages and find the desired Composer package.

  7. Open the package properties page.

  8. In the snippets field, select your tool and copy the snippet code. For example:

    composer require mypackage:dev

  9. Run the snippet on your local machine.

Last modified: 06 October 2022