Authentication Guide
Run one command to authenticate. The CLI handles everything automatically.
Get started with Three Blocks by subscribing to access private packages.
Run the CLI once to authenticate. It configures everything automatically.
npx -y three-blocks-login@latest
The CLI opens your browser to log in with your Three Blocks account. After authentication, it automatically creates .npmrc with the registry URL and auth token.
● Browser login (default) - Opens browser, one-click authentication
● Paste secret key - For headless environments, paste your tb_ key
npm install @three-blocks/core@latest Done!
You're authenticated and ready to code.
Tokens expire after 12 hours. If you see 401 errors, just run npx -y three-blocks-login@latest again.
Configure your CI to run the login CLI before install. Works with all platforms.
pnpm users: Don't use preinstall hooks. pnpm resolves packages BEFORE running preinstall scripts, causing 401 errors. Use the CI config approach below.
Add THREE_BLOCKS_SECRET_KEY to your CI environment variables. Your key starts with tb_ and can be found in your account dashboard.
Vercel: Project Settings → Environment Variables
Amplify: App Settings → Environment Variables
GitHub Actions: Settings → Secrets and Variables → Actions
Netlify: Site Settings → Environment Variables
The login CLI creates .npmrc with registry + token at build time.
{
"installCommand": "npx -y three-blocks-login@latest && pnpm install"
} version: 1
frontend:
phases:
preBuild:
commands:
- npx -y three-blocks-login@latest
- pnpm install
build:
commands:
- pnpm build - name: Auth three-blocks
run: npx -y three-blocks-login@latest
env:
THREE_BLOCKS_SECRET_KEY: ${{ secrets.THREE_BLOCKS_SECRET_KEY }}
- name: Install dependencies
run: pnpm install [build]
command = "npx -y three-blocks-login@latest && pnpm install && pnpm build" Alternative: preinstall hook (npm/yarn only)
Does NOT work with pnpm - pnpm resolves packages before preinstall runs.
{
"scripts": {
"preinstall": "npx -y three-blocks-login@latest"
}
} That's it!
CI runs login before install, creating fresh auth every build.
npm/pnpm says "Unable to authenticate"
Token expired (most common)
Solution: Run npx -y three-blocks-login@latest again
CI: License key not set
Solution: Add THREE_BLOCKS_SECRET_KEY to CI environment variables
Invalid or expired license
Solution: Check your account dashboard for subscription status
Works locally but fails on Vercel
1. Check environment variable
Vercel → Project Settings → Environment Variables → Verify THREE_BLOCKS_SECRET_KEY exists
2. Check vercel.json
Ensure installCommand runs login before install
3. Check build logs
Look for "three-blocks-login" and "✓ Authentication successful"
.gitignore. We're here to help! Reach out through any of these channels: