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
- ContractShield watches the policy file for changes
- On change, the new policy is validated
- If valid, the policy is swapped atomically
- If invalid, the old policy continues (logged warning)
Manual Reload
import { reloadPolicy } from '@cshield/pep-express';
// Trigger manual reloadawait reloadPolicy();