# Passing custom parameters to pre registration action

**URL:** <https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [July 19, 2024, 2:44pm UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321 "2024-07-19T14:44:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![evan.sk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evan.sk/32/52908_2.png) [@evan.sk](https://community.auth0.com/u/evan.sk)\
**Post date:** [July 19, 2024, 2:44pm UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321/1 "2024-07-19T14:44:59Z")

</div>

Hi, my ask is similar to this one:

> [@Passing custom parameters to pre-registration action from New Universal Login](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action-from-new-universal-login/71594):
>
> Hi all, We are investigating pre-registration actions and we are using [GitHub - auth0/auth0-react: Auth0 SDK for React Single Page Applications (SPA)](https://github.com/auth0/auth0-react) library with “New Universal Login”. Are we able to pass a custom parameter from to Auth0 sign-up page and forward it to the pre-registration action (after the user clicks on the sign-up button)? We need those parameters only during the registration process. We need to use that parameter to determine if the user is eligible for registration or no…

I need to pass a custom parameter to a pre registration action, or by some other means set a value in user\_metadata before registration. This value is needed to customize the ‘validate email’ email sent by Auth0. If I use the login action then the value is not available in the metadata before the email is sent.

This is not relevant to security for me since it’s just adding some copy to an email. I’m not controlling access with this value. Also I do not wish to use the invitation flow as that is not straightforward enough for the user. Please advise on what options I have.

Thanks

---

<div class="post-metadata">

**Author:** ![evan.sk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evan.sk/32/52908_2.png) [@evan.sk](https://community.auth0.com/u/evan.sk)\
**Post date:** [July 24, 2024, 3:54pm UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321/3 "2024-07-24T15:54:20Z")

</div>

> [@jack456jokky](#):
>
> ex.exports.onExecutePreUserRegistration = async (event, api) =\> {  
> const customParam = event.request.query.custom\_param;  
> api.user.setUserMetadata(‘custom\_param’, customParam);  
> };

This doesn’t seem possible for `onExecutePreUserRegistration`. I get an error in the logs for the action that `event.request.query` is undefined

---

<div class="post-metadata">

**Author:** ![evan.sk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evan.sk/32/52908_2.png) [@evan.sk](https://community.auth0.com/u/evan.sk)\
**Post date:** [August 7, 2024, 3:33pm UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321/4 "2024-08-07T15:33:57Z")

</div>

Does anyone know if this is possible in any way?

---

<div class="post-metadata">

**Author:** ![emma.roberts](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emma.roberts/32/60386_2.png) [@emma.roberts](https://community.auth0.com/u/emma.roberts)\
**Post date:** [August 29, 2024, 10:51am UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321/5 "2024-08-29T10:51:53Z")

</div>

I’m experiencing the same issue.

Have you found a solution for this by any chance?

---

<div class="post-metadata">

**Author:** ![emma.roberts](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/emma.roberts/32/60386_2.png) [@emma.roberts](https://community.auth0.com/u/emma.roberts)\
**Post date:** [August 30, 2024, 1:52pm UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321/6 "2024-08-30T13:52:21Z")

</div>

Found a workaround, using custom prompts by adding a hidden input which is then accessible in the pre-reg action

```auto
<div class="ulp-field" hidden="hidden">
    <input type="text"
           name="ulp-custom-field" id="realm" value="{{transaction.params.ext-customField}}">
</div>

```

In the pre-reg action you can then do something like this:

```auto
exports.onExecutePreUserRegistration = async (event, api) => {
    const field = event.request.body['ulp-custom-field'];
}

```

Auth0 reference for the solution:  
[https://auth0.com/docs/customize/login-pages/universal-login/customize-templates#custom-query-parameters](https://auth0.com/docs/customize/login-pages/universal-login/customize-templates#custom-query-parameters)

This github issue showed how it should work:

> <https://github.com/auth0/nextjs-auth0/issues/680#issuecomment-1713954412>
>
> \### Description
> 
> I am trying to branch the process using the value of custom\_p…aram in the context for the user who signed up.
> 
> In \`@auth0/auth0-react\`, \`loginWithRedirect()\` I was able to pass custom\_param to Option.
> 
> How is this correct in \`@auth0/nextjs-auth0\`? Or is this not possible at the moment?
> 
> 
> \### Environment
> 
> \- \*\*Version of this library used:\*\*: "@auth0/nextjs-auth0": "^1.9.0"
> \- \*\*Version of the platform or framework used, if applicable:\*\*: "next": "12.1.6"

---

<div class="post-metadata">

**Author:** ![evan.sk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/evan.sk/32/52908_2.png) [@evan.sk](https://community.auth0.com/u/evan.sk)\
**Post date:** [August 30, 2024, 3:36pm UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321/7 "2024-08-30T15:36:35Z")

</div>

Good find! I will give this a try. A bit convoluted but better than nothing I suppose

---

<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:** [April 8, 2025, 7:10pm UTC](https://community.auth0.com/t/passing-custom-parameters-to-pre-registration-action/139321/8 "2025-04-08T19:10:15Z")

</div>

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