Gero Nexus uses JWT (JSON Web Token) authentication. All API requests must include a valid access token in theDocumentation Index
Fetch the complete documentation index at: https://nexus.gerowallet.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Authorization header.
Authentication Methods
Gero Nexus supports two authentication methods depending on your use case:User Authentication
For web applications
- Requires email and password
- Full account features
- Linked to user account
Device Authentication
For mobile apps
- No credentials required
- Device-based tokens
- Auto-registration
Quick Start
1. Get Your Access Token
- User Login
- Device Auth
2. Use the Token
Include the access token in theAuthorization header for all API requests:
User Authentication
For web applications and services that require user accounts.Register a New Account
Login
Logout
Invalidates the current session and refresh token:Device Authentication
For mobile applications that don’t require user credentials. Devices are automatically registered on first use.Authenticate Device
Platform Values
| Platform | Description |
|---|---|
IOS | iOS devices (iPhone, iPad) |
ANDROID | Android devices |
WEB | Web browsers |
Token Management
Token Structure
When you authenticate, you receive:| Field | Description |
|---|---|
accessToken | Short-lived token for API requests (1 hour) |
refreshToken | Long-lived token to get new access tokens (7 days) |
tokenType | Always Bearer |
expiresIn | Access token lifetime in milliseconds |
Refresh Tokens
Before your access token expires, use the refresh token to get a new one:- User Refresh
- Device Refresh
Refresh tokens are single-use. Each refresh returns a new refresh token.
Making Authenticated Requests
Include the access token in theAuthorization header:
Example: Secure API Client
Here’s a production-ready example with automatic token refresh:Error Handling
Common Authentication Errors
Invalid or expired tokenSolution: Refresh your access token or re-authenticate.
Wrong email or passwordSolution: Check your credentials and try again.
Insufficient permissionsSolution: Check if your account has the required role/permissions.
Best Practices
Secure Token Storage
Secure Token Storage
Web Applications:
- Store tokens in
httpOnlycookies when possible - Use
localStorageonly if cookies aren’t an option - Never store tokens in
sessionStoragefor persistent auth
- Use iOS Keychain or Android Keystore
- Never store tokens in plain text
- Clear tokens on logout and app uninstall
- Store tokens in secure environment variables
- Use secret management services (AWS Secrets Manager, HashiCorp Vault)
- Never log tokens
Token Refresh Strategy
Token Refresh Strategy
- Refresh tokens proactively before expiry (60 seconds buffer)
- Implement retry logic for failed refreshes
- Handle refresh token expiry by re-authenticating
- Queue requests while refreshing to avoid race conditions
Device ID Generation
Device ID Generation
iOS:Android:Web:
Error Recovery
Error Recovery
Handle token errors gracefully:
- 401 with valid refresh token → Refresh and retry
- 401 with expired refresh token → Re-authenticate
- Network error → Retry with exponential backoff
- 403 → Check user permissions, may need different credentials
Next Steps
Quick Start
Make your first authenticated API call
Rate Limits
Understand rate limiting and quotas
Error Handling
Learn how to handle API errors
API Reference
Explore all available endpoints
Security Question? Contact our security team at security@gerowallet.io