How to Point Composer at Chainsaw

Beginner 15 minutes Developers / DevOps Engineers Getting Started

Configure Composer (PHP) to resolve packages through your Chainsaw Packagist mirror via composer.json.

Overview

Point Composer at your Chainsaw instance so PHP dependency resolution mirrors Packagist through the firewall. This page covers the composer.json repository and http-basic credential blocks.

Replace chain305.com with your own Chainsaw deployment host and swap CLIENT_ID / CLIENT_SECRET for credentials issued from the Access page in the dashboard. The @default segment is the org slug — confirm yours under Settings → Organization → Slug. Legacy non-org-scoped URLs return HTTP 400 with error CHW-4314.

Prerequisites

  • A running Chainsaw instance (see Tutorial 01)
  • Client credentials (Client ID and Secret)
  • PHP and Composer installed

Clear Local Caches (First-Time Setup)

rm -rf vendor composer.lock
composer clear-cache

composer.json

{
  "repositories": [
    {
      "type": "composer",
      "url": "https://chain305.com/chainproxy/repository/@default/packagist/"
    }
  ],
  "config": {
    "http-basic": {
      "chain305.com": {
        "username": "CLIENT_ID",
        "password": "CLIENT_SECRET"
      }
    }
  }
}

Verify

Run composer install, then confirm with chainsaw doctor verify-hook and the Traffic page in the dashboard.

Next Steps