How samuelhitzinger/dnd-beyond-api works
D&D Beyond Character API is a browser extension plus a local .NET HTTP bridge. The principal workflow is: choose a character in the browser, let the extension use browser-owned authentication to read or control that character, then expose the result to local applications over authenticated loopback HTTP. The graph preserves the documented character-control, sheet, and roll capabilities. Some extension-to-native-host wiring and unsampled UI behavior are documented but not visible in excerpts, so those links are marked unverified.
Main entry points: local-api.js Browser local API · script-api.js Character routes · http-read.js Authenticated reader · RelayHost.cs Request relay
Components 20
Browser extension
- Character picker UI
extensions/dndbeyond/ui/picker.js - Picker client
extensions/dndbeyond/ui/picker-client.js - Extension background
extensions/dndbeyond/background.js - Browser local API
extensions/dndbeyond/local-api.js - Host identity
extensions/dndbeyond/identity.js
Character operations
- Account characters
extensions/dndbeyond/account-characters.js - Authenticated reader
extensions/dndbeyond/http-read.js - Character routes
extensions/dndbeyond/script-api.js - Summary and control
extensions/dndbeyond/character-summary.js - Sheet operations
extensions/dndbeyond/sheet-api.js - Local rolls
extensions/dndbeyond/script-rolls.js
Local bridge
- CLI client
backend/character-api-cli/Program.cs - Native host entry
backend/character-api/Program.cs - Request relay
backend/character-api/RelayHost.cs - Native framing
backend/character-api/NativeFrames.cs - Loopback HTTP API
backend/character-api/LocalHttpApi.cs - HTTP config and bearer
backend/character-api/LocalHttpApi.cs
Other components
- Browser user
- Local applications
- D&D Beyond
Connections 23
- Browser user → Character picker UI: chooses character
README.md - Character picker UI → Picker client: uses client
extensions/dndbeyond/ui/picker.js - Extension background → Browser local API: initializes
extensions/dndbeyond/background.js - Browser local API → Host identity: loads host identity
extensions/dndbeyond/local-api.js - Browser local API → Authenticated reader: requests character data
extensions/dndbeyond/local-api.js - Browser local API → Character routes: creates routes
extensions/dndbeyond/local-api.js - Authenticated reader → Account characters: parses account list
extensions/dndbeyond/http-read.js - Authenticated reader → Character routes: builds character URL
extensions/dndbeyond/http-read.js - Authenticated reader → D&D Beyond: authenticates and fetches
extensions/dndbeyond/http-read.js - Character routes → Summary and control: dispatches control
extensions/dndbeyond/script-api.js - Character routes → Local rolls: dispatches rolls
extensions/dndbeyond/script-api.js - Character routes → Sheet operations: dispatches sheet routes
extensions/dndbeyond/script-api.js - Character routes → Authenticated reader: performs upstream requests
extensions/dndbeyond/http-read.js - Local applications → CLI client: runs requests
README.md - Local applications → Loopback HTTP API: sends authenticated HTTP
README.md - Native host entry → Request relay: starts relay
backend/character-api/Program.cs - Request relay → Loopback HTTP API: starts listener and dispatch
backend/character-api/RelayHost.cs - Request relay → Native framing: reads and writes frames
backend/character-api/RelayHost.cs - Loopback HTTP API → Request relay: dispatches requests
backend/character-api/RelayHost.cs - Loopback HTTP API → HTTP config and bearer: reads and writes config
backend/character-api/LocalHttpApi.cs - Browser local API → Native host entry: connects native host
- Picker client → Browser local API: loads selection state
- Request relay → Browser local API: exchanges browser requests