# Injecting custom script in Auth0 Form for custom consent flow using custom-form prompt

**URL:** <https://community.auth0.com/t/injecting-custom-script-in-auth0-form-for-custom-consent-flow-using-custom-form-prompt/198416>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [March 27, 2026, 4:11pm UTC](https://community.auth0.com/t/injecting-custom-script-in-auth0-form-for-custom-consent-flow-using-custom-form-prompt/198416 "2026-03-27T16:11:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathan.shanmugapriya](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kathan.shanmugapriya/32/78743_2.png) [@kathan.shanmugapriya](https://community.auth0.com/u/kathan.shanmugapriya)\
**Post date:** [March 27, 2026, 4:11pm UTC](https://community.auth0.com/t/injecting-custom-script-in-auth0-form-for-custom-consent-flow-using-custom-form-prompt/198416/1 "2026-03-27T16:11:48Z")

</div>

Hi Auth0 Community,

We’re building a custom consent flow using Auth0 Universal Login (ACUL) and have run into a few questions we’d love some guidance on.

**Our setup:**

- We’re using `auth0_prompt_screen_renderer` with `head_tags` to inject a custom JS bundle for prompts like `login` and `signup`

- For our custom consent screen, we were using our own`xxx-consent` as the prompt/screen type, but this is not a valid Auth0 prompt type

- We’ve been advised to use the **Auth0 Forms** approach with the `custom-form` prompt instead

- The Auth0 dashboard does not expose `custom-form` as an option, so this would need to be configured entirely via Terraform/API

**Questions:**

1. What is the correct way to inject a custom JS bundle inside an Auth0 Form for a `custom-form` prompt?

2. Since Auth0 Forms have no context, what is the recommended way to export variables like `user.email`, `client.name`, `client.logo_uri`, and `tenant.friendly_name` through the page template so they’re accessible to the custom script?

3. How do you distinguish between multiple `custom-form` flows — is passing a param via the authorization URL the recommended approach?

4. What is the recommended approach for handling translations inside Auth0 Forms given that `screen.texts` context is not available?

5. Is `custom-form` the intended prompt type for custom consent , or is `customized-consent` more appropriate for this use case?

Any guidance or examples would be greatly appreciated. Thanks!

---

<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 31, 2026, 4:44pm UTC](https://community.auth0.com/t/injecting-custom-script-in-auth0-form-for-custom-consent-flow-using-custom-form-prompt/198416/3 "2026-03-31T16:44:03Z")

</div>

Hi @kathan.shanmugapriya

> - The Auth0 dashboard does not expose `custom-form` as an option, so this would need to be configured entirely via Terraform/API

In order to create a custom consent screen using Forms, you can make use of the components, flows and steps available. There is an option to [create a form](https://auth0.com/docs/api/management/v2/forms/create-form) using the Management API, however, it would require you to have a great understanding of how the form’s JSON syntax works in order to build a coherent one. Knowing this, I would highly recommend using the visualizer built within the Auth0 Dashboard.

> 1. What is the correct way to inject a custom JS bundle inside an Auth0 Form for a `custom-form` prompt?  
> You will be able to use the Custom Component or an HTML block in order to inject/use any kind of JS code which you want to implement inside your form.

> 1. Since Auth0 Forms have no context, what is the recommended way to export variables like `user.email`, `client.name`, `client.logo_uri`, and `tenant.friendly_name` through the page template so they’re accessible to the custom script?

You can access variables through some [helper functions](https://auth0.com/docs/customize/forms/variables) inside the forms directly:

- user.email → {{context.user.email}}
- client.name → {{context.client.name}}
- tenant.name → {{context.tenant.name}}

Things such as the `logo_uri` need to be set directly within the form using an Image component. Alternatively, you can set them inside the action and then access them later as such:

```auto
exports.onExecutePostLogin = async (event, api) => {
  api.prompt.render(':form_id', {
    vars: {
      logo_uri: 'logo_uri',
    }
  });
}

//Later accessed as {{vars.logo_uri}}

```

> 1. How do you distinguish between multiple `custom-form` flows — is passing a param via the authorization URL the recommended approach?

If you need to have separate forms for separate applications, you can render the one you need using the action directly as such:

```auto
exports.onExecutePostLogin = async (event, api) => {
  if (event.client.name === 'App A') {
    api.prompt.render('form_id_1'); // Triggers Flow 1
  } else if (event.client.name === 'App B') {
    api.prompt.render('form_id_2'); // Triggers Flow 2
  }
};

```

> 1. What is the recommended approach for handling translations inside Auth0 Forms given that `screen.texts` context is not available?

Auth0 Forms has its own dedicated localization engine. In the Auth0 Forms visual editor, there is a dedicated **Translations** tab.  
You define your supported languages and provide the translated strings for every UI element (labels, buttons, error messages) directly within the Form configuration.  
The Form automatically detects the user’s locale (passed down from the Universal Login session) and renders the correct language.

> 1. Is `custom-form` the intended prompt type for custom consent , or is `customized-consent` more appropriate for this use case?

The Forms feature is the intended approach for a Custom consent flow —things such as accepting a custom EULA, agreeing to complex Data Processing Agreements (DMA), marketing opt-ins, or presenting specific dynamic checkboxes.

If you have any other questions, let me know!

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:** [April 14, 2026, 4:44pm UTC](https://community.auth0.com/t/injecting-custom-script-in-auth0-form-for-custom-consent-flow-using-custom-form-prompt/198416/4 "2026-04-14T16:44:44Z")

</div>

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