SHARDWIRE
Guides

Strict Startup

Use strict startup to fail fast when manifests, intents, subscriptions, or negotiated capabilities drift apart.

Strict startup is how you turn documentation and intent into an executable startup gate.

Example

import { connectBotBridge, defineShardwireApp } from 'shardwire';

const manifest = defineShardwireApp({
  name: 'dashboard',
  events: ['messageCreate'],
  actions: ['sendMessage'],
});

const app = connectBotBridge({
  url: process.env.SHARDWIRE_URL!,
  secret: process.env.SHARDWIRE_SECRET!,
});

app.on('messageCreate', ({ message }) => {
  console.log(message.content);
});

await app.ready({
  strict: true,
  manifest,
  botIntents: ['Guilds', 'GuildMessages', 'MessageContent'],
});

What strict startup can reject

  • required events missing from negotiated capabilities
  • required actions missing from negotiated capabilities
  • manifest events whose required intents were not enabled
  • runtime subscriptions that are not declared by the manifest
  • optional expectedScope drift when negotiation is broader than intended

What it changes operationally

Instead of debugging a “handler that never fires,” you get a startup-time diagnosis report and, in strict mode, a ShardwireStrictStartupError.

On this page