Skip to content

Package Registry (Verdaccio)

TrickleCharge utilizes a private Verdaccio instance for hosting and distributing Unity Package Manager (UPM) packages.

  • Registry URL: https://npm.tricklecharge.dev
  • Scope Target: com.tricklecharge.* / @tricklecharge

Consuming Packages in Unity

1. Scoped Registry Setup

To consume packages from the private registry in a Unity project, add the TrickleCharge registry via the Unity project settings:

Project SettingsPackage ManagerScoped Registries

Field Value
Name TrickleCharge Registry
URL https://npm.tricklecharge.dev/
Scope com.tricklecharge

Or configure Packages/manifest.json:

{
  "dependencies": {
    "com.tricklecharge.unity.example": "1.0.0"
  },
  "scopedRegistries": [
    {
      "name": "TrickleCharge Registry",
      "url": "https://npm.tricklecharge.dev/",
      "scopes": [
        "com.tricklecharge"
      ]
    }
  ]
}

Note:

Unity does not support the @tricklecharge scope notation.


2. Unity Package Manager (UPM) Authentication

Public packages do not require authentication. For private packages requiring authorization, Unity requires credentials stored in .upmconfig.toml (not ~/.npmrc).

Step 1: Get your Registry Token

  1. Navigate to the TrickleCharge Registry Dashboard.
  2. Click the Login button and select Login with GitHub.
  3. Once authenticated, click on the ⚙️ gear icon in the top right corner.
  4. Expand the npm section.
  5. Copy your generated Auth Token from the provided npm configuration snippet (only copy the token text inside quotes).

Example Snippet:

npm config set //npm.tricklecharge.dev/:_authToken "xxxxxxxxxxx"
In this example, xxxxxxxxxxx is your auth token.


Step 2: Configure UPM

Config File Location
OS Path
Linux / macOS ~/.upmconfig.toml
Windows %USERPROFILE%\.upmconfig.toml
Quick-Setup Scripts

Linux / macOS / WSL:

bash <(curl -sSL https://raw.githubusercontent.com/Trickle-Charge/packages-unity/main/scripts/configure-upm-auth.sh)

or directly via terminal:

printf "Enter your TrickleCharge Registry Token: " && read -r REGISTRY_TOKEN && \
cat <<EOF>> ~/.upmconfig.toml

[npmAuth."https://npm.tricklecharge.dev/"]
_authToken = "$REGISTRY_TOKEN"
alwaysAuth = true
EOF

Windows (PowerShell):

irm https://raw.githubusercontent.com/Trickle-Charge/packages-unity/main/scripts/configure-upm-auth.ps1 | iex

or directly via terminal:

& {
    $Token = Read-Host "Enter your TrickleCharge Registry Token"
    $ConfigPath = Join-Path $Home ".upmconfig.toml"
    $ConfigLines = @(
        "`n"
        '[npmAuth."https://npm.tricklecharge.dev/"]'
        "_authToken = `"$Token`""
        "alwaysAuth = true"
    )

    Add-Content -Path $ConfigPath -Value $ConfigLines
}
Manual Configuration

Add the following entry to your .upmconfig.toml file:

[npmAuth."https://npm.tricklecharge.dev/"]
_authToken = "YOUR_AUTH_TOKEN"
alwaysAuth = true

CLI & CI Authentication

CI/CD Pipelines

Automation workflows authenticate using an authToken written to ~/.npmrc:

//npm.tricklecharge.dev/:_authToken=${NODE_AUTH_TOKEN}

Local npm CLI Development

To publish or query packages outside Unity via standard npm:

npm login --registry https://npm.tricklecharge.dev/

Versioning Policy

  • Immutable Releases: Once a package version (e.g., 1.2.0) is published to Verdaccio, it should not be overwritten.
  • Automatic Detection: CI pipelines check Verdaccio prior to packing. To trigger a release, bump the "version" string in package.json.