Loading Edge Analytics
Preparing your analytics dashboard...
Get started with Edge Analytics in minutes using our SDKs or REST API.
// Install: npm install @edge-analytics/sdk
import { EdgeAnalytics } from '@edge-analytics/sdk';
const analytics = new EdgeAnalytics({
apiKey: 'your-api-key',
projectId: 'your-project-id'
});
// Track events
analytics.track('user_signup', {
userId: '12345',
plan: 'professional'
});
// Real-time metrics
analytics.realtime.subscribe('active_users', (count) => {
console.log('Active users:', count);
});# Install: pip install edge-analytics
from edge_analytics import EdgeAnalytics
analytics = EdgeAnalytics(
api_key='your-api-key',
project_id='your-project-id'
)
# Track events
analytics.track('user_signup', {
'user_id': '12345',
'plan': 'professional'
})
# Query analytics
results = analytics.query("""
SELECT event, COUNT(*) as count
FROM events
WHERE timestamp > now() - interval 1 day
GROUP BY event
""")// Install: npm install @edge-analytics/react
import { EdgeAnalyticsProvider, useAnalytics } from '@edge-analytics/react';
function App() {
return (
<EdgeAnalyticsProvider
apiKey="your-api-key"
projectId="your-project-id"
>
<Dashboard />
</EdgeAnalyticsProvider>
);
}
function Dashboard() {
const { track, metrics } = useAnalytics();
const handleClick = () => {
track('button_click', { button: 'cta' });
};
return (
<div>
<h1>Active Users: {metrics.activeUsers}</h1>
<button onClick={handleClick}>Track Click</button>
</div>
);
}Complete reference for all Edge Analytics API endpoints with examples and response formats.
Real-time analytics processing with Workers Analytics Engine
/api/analytics/:project_id/eventsProcess analytics events (writes to WAE)
curl -X POST "https://api.edgeanalytics.com/api/analytics/proj_123/events" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"event": "page_view",
"properties": {
"page": "/dashboard",
"user_id": "user_456",
"timestamp": "2024-01-15T10:30:00Z"
}
}'/api/analytics/:project_id/metricsReal-time metrics (queries WAE)
curl -X GET "https://api.edgeanalytics.com/api/analytics/proj_123/metrics?timeRange=24h&metric=page_views" \
-H "Authorization: Bearer YOUR_API_KEY"/api/analytics/:project_id/queryCustom SQL queries to WAE
curl -X POST "https://api.edgeanalytics.com/api/analytics/proj_123/query" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "SELECT event, COUNT(*) as count FROM events WHERE timestamp > now() - interval 1 day GROUP BY event"
}'WebSocket connections and live updates
User authentication and JWT management
Our API is built for speed and reliability with global edge processing.