Rootree
Github Logo

Using our Private Packages

Github Logo

Do you want to make use of our NPM and Composer packages? Then these are the walk-through for you! The first few steps are common between the two, after that we will split off into the two processes.

  1. Go to your GitHub account settings.
  2. Click on Developer Settings
  3. Click on Personal Access Tokens -> Tokens (Classic)
  4. Click to generate a new token (Classic)
  5. Give it a name that you will recognize (ex. RootreeWeb GitHub Packages)
  6. Give access to repository and read:packages
  7. Copy the token that is generated
  8. The rest of the steps are different depending on whether you are using NPM or Composer

NPM

  1. Create an environment variable named “GHACCESS” and set it to the token that you generated.

  2. If you are working with a project that has already been using our NPM packages, you should be all set, otherwise…

  3. Depending on your package manager/environment, you will need to add the following to your configuration file:

    Yarn

    Create or add to your .yarnrc.yml file:

    npmScopes:
      rootreeweb:
        npmAlwaysAuth: true
        npmAuthToken: "${GHACCESS}"
        npmRegistryServer: "https://npm.pkg.github.com"

    This tells Yarn to look at the GitHub repository for any packages that start with @rootreeweb. Run yarn install to test your configuration.

    Bun

    Create or add to your bunfig.toml file:

    [install.scopes]
    "@rootreeweb" = { token = "$GHACCESS", url = "https://npm.pkg.github.com" }

Composer

  1. Ensure that your composer.json file has the repository that you wish to include indicated. ex.

    {
    	"version": "3.2.8",
    	"repositories": [
    		{
    			"type": "vcs",
    			"url": "https://github.com/rootreeweb/rt-plugin-lib.git"
    		}
    	],
    	"require": {
    		"php": "8.4.*",
    		"rootree/plugin-lib": "dev-main"
    	}
    }
  2. Run composer install it will prompt you for the access token that you generated.

Appendix: Publishing

This content has been moved to Publishing Packages.