API Key Management
This guide explains how to obtain API keys from the MOSA admin dashboard for SDK integration.
Overview
API keys are required for SDK initialization and authentication. Each API key is associated with an organization.
Obtaining API Keys
Step 1: Access Admin Dashboard
- Log in to the MOSA admin dashboard (contact MOSA for access)
- Navigate to Settings → API Keys
Step 2: Create API Key
- Click Create API Key
- Provide a name for the key (e.g., "Mobile App Production")
- Select permissions/scopes (if applicable)
- Click Create
Step 3: Copy API Key
- Copy the generated API key immediately
- Important: API keys are only shown once - store securely
- Use the key in your SDK initialization
Using API Keys
Initialize SDK with API Key
- Android
- iOS
- Flutter
val sdk = MOSADockSDK.builder()
.setActivity(this)
.setApiKey("your-api-key-here") // Use your API key
.setUserId("user-123")
.build()
MosaDockSDK.initialize(
with: self,
apiKey: "your-api-key-here", // Use your API key
userId: "user-123"
)
await mosaDockSdk.initialize(
apiKey: 'your-api-key-here', // Use your API key
userId: 'user-123',
);
Security Best Practices
1. Store Securely
- Never commit API keys to version control
- Use environment variables or secure storage
- Use different keys for development and production
2. Rotate Regularly
- Rotate API keys periodically
- Revoke compromised keys immediately
- Update keys in all environments
3. Limit Access
- Use separate keys for different environments
- Restrict key permissions when possible
- Monitor key usage
Environment-Specific Keys
Development
Use a development API key for testing:
val apiKey = if (BuildConfig.DEBUG) {
"dev-api-key"
} else {
"prod-api-key"
}
Production
Use a production API key for release builds:
- Store in secure configuration
- Never expose in client-side code if possible
- Consider backend proxy for additional security
Troubleshooting
Invalid API Key Error
If you receive an authentication error:
- Verify API key is correct (no extra spaces)
- Check API key is active in admin dashboard
- Ensure API key has required permissions
- Verify organization access
Key Not Found
If API key is not found:
- Check key was copied correctly
- Verify key exists in admin dashboard
- Ensure key hasn't been revoked
- Contact support if issue persists
Next Steps
- Getting Started - Complete integration guide
- Platform Guides - Platform-specific setup
For admin dashboard access, contact MOSA support.