Applications
Legacy guide - retired af CLI
This page was written for the retired af CLI and the sites/storage workflow.
The current CLI is acc (compute services), which does not include these
commands yet. Commands on this page will not work with acc. Kept for
reference while this functionality is rebuilt.
Applications in Alternate Futures allow you to create OAuth applications and manage whitelisted domains for CORS and authentication purposes.
What are Applications?
Applications are OAuth 2.0 applications that can authenticate users and access the Alternate Futures API on their behalf. Each application has:
- Client ID - Public identifier for your application
- Name - Human-readable application name
- Whitelist Domains - Allowed domains for CORS and OAuth redirects
Creating an Application
# Create a new application
af applications create
# You'll be prompted for:
# - Application name
# - Whitelist domains (comma-separated)Listing Applications
# List all applications
af applications listUpdating an Application
# Update an application
af applications update
# You'll be prompted to:
# 1. Select the application
# 2. Update name and/or whitelist domainsDeleting an Application
# Delete an application
af applications delete
# You'll be prompted to select which application to deleteUse Cases
Web Application Authentication
Use applications to authenticate users in your web application:
- Create an application with your production and staging domains whitelisted
- Use the Client ID in your OAuth flow
- Users can sign in with their Alternate Futures account
- Your application receives an access token to make API calls
CORS Configuration
Whitelist domains are automatically allowed for CORS requests:
// This request will succeed if the origin is whitelisted
fetch('https://api.alternatefutures.ai/v1/sites', {
headers: {
'Authorization': `Bearer ${accessToken}`
}
});Multi-Environment Setup
Create separate applications for different environments:
# Development app
af applications create
# Name: My App (Dev)
# Domains: http://localhost:3000
# Production app
af applications create
# Name: My App (Prod)
# Domains: https://myapp.com, https://www.myapp.comSecurity Best Practices
Security
- Only whitelist domains you control
- Use HTTPS for all production domains
- Create separate applications for different environments
- Regularly audit your whitelist domains
- Delete unused applications
Next Steps
- Authentication - Set up authentication methods
- API Keys - Generate API keys for server-side access
- CLI Commands - Complete CLI reference
Observability and APM
Monitor your applications with distributed tracing, metrics, and logging. The Alternate Futures Observability platform provides full APM (Application Performanc
Private gateways
Create dedicated IPFS gateways with custom domains for fast, reliable access to your decentralized content.