Configure access to @prusa3d-platform private packages.
One command to set up your local development environment.
The scripts are behind Cloudflare Access, so they are fetched through cloudflared. Install it and log in once, then run setup:
# once: install cloudflared and log in (re-run login when it expires) brew install cloudflared cloudflared access login https://npm-token.prusa3d.dev
# once: install cloudflared and log in (re-run login when it expires) winget install --id Cloudflare.cloudflared cloudflared access login https://npm-token.prusa3d.dev
cloudflared access curl https://npm-token.prusa3d.dev/setup | bash
cloudflared access curl https://npm-token.prusa3d.dev/setup.ps1 | Out-String | iex
Creates a new token, or validates existing one. If token is expired or invalid, prompts to create a new one.
To revoke your token and remove local configuration:
cloudflared access curl https://npm-token.prusa3d.dev/revoke | bash
cloudflared access curl https://npm-token.prusa3d.dev/revoke.ps1 | Out-String | iex
Revokes the token via GitLab API and removes the local token file.
~/.config/prusa/npm-token (chmod 600)%LOCALAPPDATA%\Prusa\npm-token (restricted ACL)
.zshrc / .bashrcIf you prefer to set things up manually:
api scope
Add to ~/.zshrc or ~/.bashrc:
export NPM_PRUSA_PLATFORM_TOKEN="glpat-your-token-here"
Run in PowerShell:
[Environment]::SetEnvironmentVariable("NPM_PRUSA_PLATFORM_TOKEN", "glpat-your-token-here", "User")
Or: Settings → System → About → Advanced system settings → Environment Variables
.npmrc in your project:
@prusa3d-platform:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken="${NPM_PRUSA_PLATFORM_TOKEN}"
@prusa3d-platform:registry=https://gitlab.com/api/v4/packages/npm/
//gitlab.com/api/v4/packages/npm/:_authToken=${NPM_PRUSA_PLATFORM_TOKEN}
Note: On Windows, use ${VAR} without quotes.
Your token is invalid or expired. Run the setup command again:
cloudflared access curl https://npm-token.prusa3d.dev/setup | bash
cloudflared access curl https://npm-token.prusa3d.dev/setup.ps1 | Out-String | iex
The token is loaded when you start a new shell. Either:
source ~/.zshrcEnvironment variables require a new terminal session. Either:
Fix permissions:
chmod 600 ~/.config/prusa/npm-token chmod 700 ~/.config/prusa
Reset file permissions (PowerShell as Administrator):
$path = "$env:LOCALAPPDATA\Prusa\npm-token" icacls $path /reset icacls $path /inheritance:r /grant:r "$($env:USERNAME):(R,W)"
If you see "running scripts is disabled on this system", run PowerShell as Administrator:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Then try the setup command again.
If you're having issues with the remote execution, you can download the scripts and run them locally:
setup.ps1 from https://npm-token.prusa3d.dev/setup.ps1revoke.ps1 from https://npm-token.prusa3d.dev/revoke.ps1Unblock-File .\setup.ps1 Unblock-File .\revoke.ps1
.\setup.ps1
Or for revoke:
.\revoke.ps1