Skip to content

Policy Hot Reload

Policy Hot Reload

Pro Feature - Requires a ContractShield Pro license.

Hot reload allows you to update policies without restarting your application.

Enable Hot Reload

app.use(contractshield({
policy: './policy.yaml',
license: process.env.CONTRACTSHIELD_LICENSE,
hotReload: true // Pro feature
}));

How It Works

  1. ContractShield watches the policy file for changes
  2. On change, the new policy is validated
  3. If valid, the policy is swapped atomically
  4. If invalid, the old policy continues (logged warning)

Manual Reload

import { reloadPolicy } from '@cshield/pep-express';
// Trigger manual reload
await reloadPolicy();