Skip to content

Guides

Dart Packages

Stout implements the pub API v2 protocol with pubspec.yaml metadata extraction. dart pub add works out of the box.

Configure Your Client

Reference the Stout hosted URL in your pubspec.yaml:

# pubspec.yaml
dependencies:
  my_package:
    hosted:
      name: my_package
      url: https://registry.stout.io/dart/myorg
    version: ^1.2.0

Or set the default hosted URL:

export PUB_HOSTED_URL=https://registry.stout.io/dart/myorg

Install a Package

dart pub get

Publish a Package

Stout builds from source. Submit a build via the API:

curl -X POST https://registry.stout.io/api/v1/builds \
  -H "Authorization: Bearer $STOUT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "dart",
    "repo": "https://github.com/myorg/my-package",
    "version": "1.2.0"
  }'

Your repository must include a pubspec.yaml at the archive root.

Authentication

For private packages, set credentials via the environment:

export PUB_TOKEN=$STOUT_TOKEN

Endpoints

Method Path Description
GET /dart/:owner/api/packages/:name List package versions
GET /dart/:owner/api/packages/:name/versions/:version Version metadata
GET /dart/:owner/packages/:name/versions/:file Download archive