Get Started

Get Started with Three.js Blocks

Two ways to set up authentication. Choose the method that fits your workflow.

Subscription Required

Unlock @three-blocks/core and advanced compute components with an active subscription.

Choose Your Setup Method

Select the authentication approach that works best for your development workflow.

Recommended

Automatic Setup

Add a preinstall hook to your package.json. Authentication runs automatically before every install—perfect for teams and CI/CD.

  • Works in Vercel, GitHub Actions, Netlify
  • Tokens never expire (auto-refresh)
  • Set and forget
Setup Automatic →

Manual CLI

Run a simple command when you need to authenticate. Great for local development and learning how it works.

  • Simpler concept, explicit control
  • No package.json changes
  • Tokens expire after 12 hours
Setup Manual →
Recommended

Automatic Authentication

Set up once, works everywhere. Perfect for production deployments.

1

Create .npmrc file

.npmrc
@three-blocks:registry=https://three-blocks-196905988268.d.codeartifact.ap-northeast-1.amazonaws.com/npm/core/

✅ Safe to commit - This file contains no secrets

Show all registry URLs

Indie Plan:

https://three-blocks-196905988268.d.codeartifact.ap-northeast-1.amazonaws.com/npm/core/

Pro / Company Plan:

https://three-blocks-196905988268.d.codeartifact.ap-northeast-1.amazonaws.com/npm/pro/
2

Add preinstall script

package.json
{
  "scripts": {
    "preinstall": "npx -y three-blocks-login@latest"
  }
}

💡 Using pnpm? Use pnpm dlx three-blocks-login@latest

3

Set your license key

.env.local
THREE_BLOCKS_SECRET_KEY=tb_your-license-key-here

⚠️ Never commit - Add .env.local to your .gitignore

🎉

You're all set!

Run pnpm install and the preinstall hook handles the rest.

Manual

Manual CLI Authentication

Run the CLI and it will prompt for your license key.

1

Run authentication CLI

The CLI will prompt for your license key and configure everything automatically.

terminal
pnpm dlx three-blocks-login

💡 The CLI configures your .npmrc with the registry URL and auth token.

2

Install packages

terminal
pnpm install @three-blocks/core

Done!

You're authenticated and ready to go.

Tokens expire after 12 hours

If you see auth errors, just run pnpm dlx three-blocks-login again to refresh your token.

Next Steps

Start Using Three Blocks

app.js
import * as THREE from 'three/webgpu';
import { Boids, SPH, Text } from '@three-blocks/core';

// Start building amazing Three.js experiences!