23blocks Platform Architecture: Edge Infrastructure & Environment Routing
We're excited to share details about our platform architecture, designed to give you the best developer experience while maintaining enterprise-grade reliability.
Edge Architecture Overview
Every API request to 23blocks flows through our global edge network:
Your App → CloudFront Edge → Lambda@Edge → Service API
CloudFront Global Edge
Requests hit one of 400+ CloudFront edge locations worldwide, ensuring sub-50ms latency regardless of where your users are located.
Lambda@Edge Routing
Our Lambda@Edge function handles intelligent routing:
- API Key Validation - Verifies your API key instantly
- Environment Detection - Routes to staging or production based on key prefix
- Service Routing - Directs traffic to the correct service backend
Per-Service URL Pattern
Each 23blocks service has its own dedicated URL:
| Service | URL |
|---|---|
| Auth | https://auth.api.us.23blocks.com |
| Content | https://content.api.us.23blocks.com |
| Files | https://files.api.us.23blocks.com |
| Forms | https://forms.api.us.23blocks.com |
| CRM | https://crm.api.us.23blocks.com |
| Wallet | https://wallet.api.us.23blocks.com |
| Onboarding | https://onboarding.api.us.23blocks.com |
| Companies | https://company.api.us.23blocks.com |
| Products | https://products.api.us.23blocks.com |
| Sales | https://sales.api.us.23blocks.com |
| Rewards | https://rewards.api.us.23blocks.com |
| Search | https://search.api.us.23blocks.com |
| University | https://university.api.us.23blocks.com |
| AI/Jarvis | https://jarvis.api.us.23blocks.com |
| Geolocation | https://geolocation.api.us.23blocks.com |
| Real Time | https://conversations.api.us.23blocks.com |
| Assets | https://assets.api.us.23blocks.com |
Environment Routing via API Keys
One of the most powerful aspects of our architecture is API key-based environment routing. Use the same URL for all environments - your API key determines where traffic goes:
| API Key Prefix | Environment |
|---|---|
pk_test_* | Staging (public key) |
sk_test_* | Staging (secret key) |
pk_live_* | Production (public key) |
sk_live_* | Production (secret key) |
Benefits
- Simpler Configuration - No environment-specific URLs to manage
- Safer Deployments - Just swap API keys, not URLs
- Consistent Testing - Same code paths in dev and production
Example Usage
// Staging
const stagingClient = new BlocksClient({
baseUrl: 'https://auth.api.us.23blocks.com',
apiKey: 'pk_test_abc123' // Routes to staging
});
// Production
const productionClient = new BlocksClient({
baseUrl: 'https://auth.api.us.23blocks.com',
apiKey: 'pk_live_xyz789' // Routes to production
});
Monitoring Infrastructure
Every service is monitored 24/7 with:
- Prometheus - Metrics collection and alerting
- Grafana - Real-time dashboards and visualization
- Loki - Centralized log aggregation
- Custom Health Checks - Per-service availability monitoring
Our SRE team receives alerts within 30 seconds of any service degradation.
Health Check Endpoints
Each service exposes a health check endpoint:
GET https://{service}.api.us.23blocks.com/health
Response:
{
"status": "healthy",
"service": "auth",
"version": "2.4.1",
"timestamp": "2026-01-20T10:30:00Z"
}
AWS Infrastructure
Behind the scenes, each service runs on:
- Application Load Balancers - SSL termination and routing
- ECS Fargate - Serverless container orchestration
- RDS Aurora - Multi-AZ PostgreSQL databases
- ElastiCache - Redis caching layer
- S3 - Durable object storage
All infrastructure is multi-AZ within the US East region, with automatic failover and daily backups.
What This Means for You
- Faster APIs - Edge routing reduces latency globally
- Simplified Code - One URL per service, environment via API key
- Enterprise Reliability - Multi-AZ, auto-scaling, 24/7 monitoring
- Zero DevOps - We handle all infrastructure management
Getting Started
Update your SDK configuration to use the new per-service URLs:
import { BlocksClient } from '@23blocks/sdk';
const client = new BlocksClient({
baseUrl: 'https://auth.api.us.23blocks.com',
apiKey: process.env.BLOCKS_API_KEY // pk_test_* or pk_live_*
});
Check out the Infrastructure Documentation for more technical details.
Questions? Join our Slack community or reach out to support@23blocks.com.
