Concepts
Bridge Architecture
Understand the bot-process versus app-process split and what Shardwire normalizes across that boundary.
Shardwire is built around a simple architectural claim: the Discord gateway lifecycle and your business logic do not need to share a process.
Bot process responsibilities
- Maintain the Discord connection.
- Declare gateway intents.
- Normalize Discord payloads into bridge-safe data models.
- Execute built-in actions on behalf of connected app processes.
- Enforce secret scope and capability negotiation.
App process responsibilities
- Connect over WebSocket with
connectBotBridge(). - Register subscriptions with
app.on(...). - Use
app.actions.*to trigger side effects on the bot side. - Run product logic, storage, dashboards, workflows, or moderation rules.
Why the split helps
- Gateway uptime is insulated from slow application code.
- App processes can scale or restart independently.
- Capability scope becomes explicit instead of implicit.
- You stop mixing Discord runtime concerns into every product service.
The contract surface
The app process does not receive raw discord.js objects. It receives normalized bridge payloads and typed action results.
That is why the generated reference includes dedicated sections for:
- Bridge APIs
- Event and data models
- Action models
- Errors and failures