Docs/Quick Start

Quick Start

Integrate EdgeURL into your application in 5 minutes

1

Environment Setup

Configure environment variables for EdgeURL integration. See SETUP.md for comprehensive setup guide.

# .env.local NEXT_PUBLIC_SUPABASE_URL=your-project.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key SUPABASE_SERVICE_ROLE_KEY=your-service-role-key KV_REST_API_URL=your-kv.upstash.io KV_REST_API_TOKEN=your-kv-token NEXT_PUBLIC_BASE_URL=http://localhost:3000 NEXT_PUBLIC_SHORT_DOMAIN=https://0gr.me

Required services: PostgreSQL database, Redis cache, and edge deployment platform

2

Generate API Key

Create an API key with appropriate permissions for programmatic access:

1. Navigate to Dashboard → API Keys
2. Click "Create API Key"
3. Set permissions: read, write
4. Copy key immediately (only shown once)
Security: API keys are SHA256 hashed before storage. Store securely and never commit to version control.
3

Create Links Programmatically

Use the REST API to create short links from your application:

curl -X POST https://edgeurl.io/api/links \ -H "Authorization: Bearer sk_live_your_api_key" \ -H "Content-Type: application/json" \ -d '{ "target_url": "https://example.com/page", "custom_slug": "my-link" }'

Response

{ "id": "uuid", "slug": "my-link", "short_url": "https://0gr.me/my-link", "target_url": "https://example.com/page", "created_at": "2024-01-01T00:00:00Z" }
Sub-5ms
KV cache lookup
Auto-primed
Cache on creation
4

Query Analytics

Retrieve analytics data via API for integration into your dashboards:

curl https://edgeurl.io/api/analytics/LINK_ID \ -H "Authorization: Bearer sk_live_your_api_key" \ -H "Content-Type: application/json"

Analytics Data Points

  • Total clicks with daily aggregations
  • Geographic distribution (country, city, region)
  • Device breakdown (mobile, desktop, tablet)
  • Browser and OS statistics
  • Referrer and UTM campaign tracking
Architecture: Analytics are batched every 5 minutes via cron job for optimal performance. See app/api/cron/flush-analytics/route.ts

Developer Resources