Authentication
How authentication works across the ThreeU developer platform.
Authentication Overview
ThreeU uses token-based authentication across all APIs. Every API request must include a valid token in the Authorization header. Different contexts require different token types, each with specific security requirements and permission scopes.
Bearer Token Authentication
All authenticated API requests use the Bearer token scheme:
Bearer Token Request
Shell
curl -X GET https://api.threeu.app/api/plugins/installed \
-H "Authorization: Bearer YOUR_TOKEN_HERE" \
-H "platform-id: my-store" \
-H "Content-Type: application/json"Developer Authentication
Developers authenticate through a dedicated flow:
- Apply — Submit a developer application through ThreeU
- Approval — ThreeU reviews and provisions a developer account with status
pending - Invite — An invitation email is sent to the developer
- Accept — Developer calls
POST /developer/accept-inviteto activate - Login —
POST /developer/loginreturns a bearer token - Bootstrap —
GET /developer/meloads the profile
Developer Auth Flow
TypeScript
// Accept invite
const response = await fetch('https://api.threeu.app/api/developer/accept-invite', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: '[email protected]',
password: 'secure_password',
password_confirmation: 'secure_password'
})
});
// Login
const loginRes = await fetch('https://api.threeu.app/api/developer/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email: '[email protected]', password: 'secure_password' })
});
const { token } = await loginRes.json();Token Safety Rules
Different tokens have different security requirements:
| Token Type | Safe in Browser? | Use Case |
|---|---|---|
| Secret Admin Token | ❌ Never | Server-side admin operations |
| Public Storefront Token | ✅ Yes | Client-side storefront data |
| Plugin Installation Token | ❌ Never | Plugin-to-ThreeU communication |
| POS Token | ⚠️ Device only | Point-of-sale terminal sessions |
| Theme Development Token | ✅ Yes | Theme preview and development |
| Developer API Token | ❌ Never | Developer console API calls |
Critical Security Warning
Secret Admin Tokens must never be exposed in the browser, client-side code, or public repositories. Always use environment variables and server-side code.