# Unable To Set Up Rules

**URL:** <https://community.auth0.com/t/unable-to-set-up-rules/183730>\
**Category:** Get Help\
**Tags:** free-trial, login-experience\
**Created:** [March 11, 2025, 8:36pm UTC](https://community.auth0.com/t/unable-to-set-up-rules/183730 "2025-03-11T20:36:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mulherje](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mulherje/32/73361_2.png) [@mulherje](https://community.auth0.com/u/mulherje)\
**Post date:** [March 11, 2025, 8:36pm UTC](https://community.auth0.com/t/unable-to-set-up-rules/183730/1 "2025-03-11T20:36:10Z")

</div>

I am following a tutorial on authentication in Node.js using Auth0 but in the instructions it says this:

Auth0 Rules are JavaScript functions that execute when a user logs in to your application. They run once the authentication process is complete, and you can use them to customize and extend Auth0’s capabilities. For security, your Rules code executes in a sandbox, isolated from the code of other Auth0 tenants.

You can create Auth0 Rules easily using the Auth0 Dashboard. Follow these steps to create a rule that adds user roles to tokens:

- Open the Rules page from the Auth0 Dashboard
- Click on the **Create Rule** button.
- Click on the **Empty Rule** option.
- Provide a **Name** to your rule, such as “Add user roles to tokens”.
- Next, replace the content of the **Script** section with the following function:

Now that rules are deprecated how would I do this?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 11, 2025, 9:23pm UTC](https://community.auth0.com/t/unable-to-set-up-rules/183730/3 "2025-03-11T21:23:43Z")

</div>

Hi @mulherje

Welcome to the Auth0 Community!

Since Rules are being deprecated, you can use [Actions](https://auth0.com/docs/customize/actions) instead. You can create custom Actions under Library and assign them to different triggers under Triggers.

If you have any other questions, feel free to leave a reply!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 25, 2025, 9:23pm UTC](https://community.auth0.com/t/unable-to-set-up-rules/183730/4 "2025-03-25T21:23:56Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
