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 Settings → Package Manager → Scoped 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
@tricklechargescope 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
- Navigate to the TrickleCharge Registry Dashboard.
- Click the Login button and select Login with GitHub.
- Once authenticated, click on the ⚙️ gear icon in the top right corner.
- Expand the npm section.
- Copy your generated Auth Token from the provided npm configuration snippet (only copy the token text inside quotes).
Example Snippet:
In this example,xxxxxxxxxxxis 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:
CLI & CI Authentication
CI/CD Pipelines
Automation workflows authenticate using an authToken written to ~/.npmrc:
Local npm CLI Development
To publish or query packages outside Unity via standard npm:
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 inpackage.json.