Documentation
Edge API
The Grids Edge API is a Cloudflare Workers-based REST API built with Hono. It provides authentication, asset management, and marketplace functionality.
Base URL
https://api.a-new-world.com
Authentication
All authenticated endpoints require a Bearer token in the Authorization header:
Authorization: Bearer <jwt_token>
Tokens are obtained via the Discord OAuth flow and are valid for 24 hours (HS256).
Infrastructure
| Service | Technology | Purpose |
|---|---|---|
| Runtime | Cloudflare Workers | Edge compute |
| Database | D1 (SQLite) | Asset metadata, user data |
| Storage | R2 | Asset files, thumbnails |
| Auth | Discord OAuth + JWT | User identity |
Endpoints Overview
| Method | Path | Description |
|---|---|---|
GET | /auth/discord | Initiate Discord OAuth |
GET | /auth/discord/callback | OAuth callback |
POST | /auth/device/code | Generate device linking code |
POST | /auth/device/link | Link game to web account |
GET | /assets | List marketplace assets |
GET | /assets/:id | Get asset metadata |
POST | /assets | Upload a new asset |
POST | /assets/:id/sign | Get signed download URL |
GET | /assets/:id/stream | XOR-scrambled asset download |
GET | /library | User's acquired assets |
POST | /library/:assetId/acquire | Add asset to library |
See the Assets and Authentication pages for detailed endpoint documentation.