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

ServiceTechnologyPurpose
RuntimeCloudflare WorkersEdge compute
DatabaseD1 (SQLite)Asset metadata, user data
StorageR2Asset files, thumbnails
AuthDiscord OAuth + JWTUser identity

Endpoints Overview

MethodPathDescription
GET/auth/discordInitiate Discord OAuth
GET/auth/discord/callbackOAuth callback
POST/auth/device/codeGenerate device linking code
POST/auth/device/linkLink game to web account
GET/assetsList marketplace assets
GET/assets/:idGet asset metadata
POST/assetsUpload a new asset
POST/assets/:id/signGet signed download URL
GET/assets/:id/streamXOR-scrambled asset download
GET/libraryUser's acquired assets
POST/library/:assetId/acquireAdd asset to library

See the Assets and Authentication pages for detailed endpoint documentation.