# What options are available for managing common custom code in rules?

**URL:** <https://community.auth0.com/t/what-options-are-available-for-managing-common-custom-code-in-rules/68931>\
**Category:** Get Help\
**Created:** [September 1, 2021, 2:51pm UTC](https://community.auth0.com/t/what-options-are-available-for-managing-common-custom-code-in-rules/68931 "2021-09-01T14:51:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aflood](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aflood/32/18977_2.png) [@aflood](https://community.auth0.com/u/aflood)\
**Post date:** [September 1, 2021, 2:51pm UTC](https://community.auth0.com/t/what-options-are-available-for-managing-common-custom-code-in-rules/68931/1 "2021-09-01T14:51:55Z")

</div>

What options are there available for managing custom javascript code for re-use in Auth0 rules, hooks or actions?

At present, our solution runs custom rules at the start of the authentication pipeline that define custom javascript objects/functions/properties on the global object. These custom functions on the global object are then referenced in rules that run later in the authentication pipeline.

Is there a better way to manage custom code? For example, is it possible to write all of our custom code in a node module and reference that custom node module in our rules? Or is it possible to use a custom extension etc?

Thanks.

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [September 2, 2021, 9:26pm UTC](https://community.auth0.com/t/what-options-are-available-for-managing-common-custom-code-in-rules/68931/3 "2021-09-02T21:26:33Z")

</div>

Hi @aflood

Welcome to the Auth0 Community!

Have you looked into Actions?

> **[Auth0 Actions](https://auth0.com/docs/customize/actions)**
>
> Describes Auth0 Actions, which are secure, tenant-specific, self-contained functions that allow you to customize the behavior of Auth0.

I’m not sure I have a clear picture of what you mean by:

> [@aflood](#):
>
> At present, our solution runs custom rules at the start of the authentication pipeline that define custom javascript objects/functions/properties on the global object. These custom functions on the global object are then referenced in rules that run later in the authentication pipeline.

Can you give an example? If you are mostly concerned with managing versioning and iterating on your rules, you can do that with Actions.

---

<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:** [December 23, 2021, 4:53pm UTC](https://community.auth0.com/t/what-options-are-available-for-managing-common-custom-code-in-rules/68931/4 "2021-12-23T16:53:05Z")

</div>

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