Authentication
Every request carries a key from your dashboard. The same key works for Alania and Duyu. Browser connections use short-lived tokens instead.
API keys
Keys start with pd_live_ and go in the Authorization: Bearer header. X-Api-Key is accepted too. Keep keys on the server; never ship them in client code.
WebSocket connections
Browser WebSockets can't set headers, so pass the key or token as a ?key= or ?token= query parameter. Use the header when you connect from a server.
Session tokens
Instead of handing the browser a key, mint a 10-minute JWT on your own server (HS256, signed with the SESSION_JWT_SECRET shared with you). The dashboard playground does exactly this.
Node