# Rules and Hooks end of life
Per Auth0's docs: the EOL date of Rules and Hooks is November 18, 2026. They are not available to new tenants created as of October 16, 2023. Existing tenants with active Rules/Hooks keep access through EOL only.
## What changes
- Rules: `function (user, context, callback)` becomes an Action with `(event, api)`. The event object is immutable; you mutate via the api object.
- Hooks: pre-user-registration, post-user-registration, etc. map to Actions triggers of the same names.
- `console.log` debugging moves to Actions real-time logs.
## Migration mechanics
1. Dashboard > Actions > Library > Build Custom. Pick the trigger matching the old Rule/Hook (post-login is the common one).
2. Convert code: `user.app_metadata` reads become `event.user.app_metadata`. Setting claims: `api.idToken.setCustomClaim(name, value)` and `api.accessToken.setCustomClaim(name, value)`; custom claim names must be namespaced (a URL like `https://YOUR-DOMAIN/[claim]`), Auth0 drops non-namespaced custom claims.
3. Secrets: Rule configuration values become Action secrets (key/value in the Action editor).
4. npm deps: Actions support public npm packages via the dependency manager in the editor.
5. Deploy the Action, then drag it into the flow (Actions > Flows) at the right position. Deploying alone does nothing until it is attached to a flow.
6. Test with the flow's test runner, then a real login, watching tenant logs.
## Common porting bugs
- Forgetting that event is read-only; assignments to event.user silently do nothing.
- Rules that called the Management API: Actions need an explicit Management API token (the event has no built-in one).
- Ordering: Rules ran in sequence; Actions in a flow run in the order you arrange them. Drag to match.
## Checklist
- Inventory every Rule and Hook now; EOL is under two months from this writing.
- Each migrated flow tested with a real login before deleting the Rule.