Skip to content

payload-hooks — Optimization

Declare an auth collection in the config to include it in auditing. Payload creates its implicit users collection after plugins run.

Write events from afterChange and afterDelete run before the database transaction commits.

Read auditing is off by default. When enabled, find logs once per request with a count, while findByID logs the document ID.

The plugin does not persist database audit records. Authentication auditing covers successful logins and password resets, not failed logins.

Package guidance · Implementation.