# How to access event.secrets in Auth0 Actions? Are there any differences between Node.js versions?

**URL:** <https://community.auth0.com/t/how-to-access-event-secrets-in-auth0-actions-are-there-any-differences-between-node-js-versions/181578>\
**Category:** Get Help\
**Tags:** login-experience, free-trial\
**Created:** [February 6, 2025, 12:21pm UTC](https://community.auth0.com/t/how-to-access-event-secrets-in-auth0-actions-are-there-any-differences-between-node-js-versions/181578 "2025-02-06T12:21:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiroaki\_ohkawa](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hiroaki_ohkawa/32/72678_2.png) [@hiroaki\_ohkawa](https://community.auth0.com/u/hiroaki_ohkawa)\
**Post date:** [February 6, 2025, 12:21pm UTC](https://community.auth0.com/t/how-to-access-event-secrets-in-auth0-actions-are-there-any-differences-between-node-js-versions/181578/1 "2025-02-06T12:21:13Z")

</div>

I am using Auth0 Actions post-login Trigger in two tenants for development.  
I ran the exact same code on two tenants.  
There are differences in the behavior of Actions between the two tenants.

1. tenant A

- Runtime: Node 18 (Not Recommended)
- can access `event.secrets.client_secret`

1. tenant B

- Runtime: Node 22 (Recommended)
- can NOT access `event.secrets.client_secret`

```auto
exports.onExecutePostLogin = async (event, api) => {
  ...
  console.log(`event.secrets.client_secret: ${event.secrets.client_secret}`);
  ...

```

In older versions it works as expected, but in newer versions it is undefined.

Also, I can’t find `secrets` in the official document `Actions Triggers: post-login - Event Object` .

It would be helpful if you could tell me where there is a document I should look at.

I would like to know how to do something similar in the latest version.

---

<div class="post-metadata">

**Author:** ![hiroaki\_ohkawa](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hiroaki_ohkawa/32/72678_2.png) [@hiroaki\_ohkawa](https://community.auth0.com/u/hiroaki_ohkawa)\
**Post date:** [February 6, 2025, 1:38pm UTC](https://community.auth0.com/t/how-to-access-event-secrets-in-auth0-actions-are-there-any-differences-between-node-js-versions/181578/2 "2025-02-06T13:38:27Z")

</div>

It seems like I can resolve this issue myself.  
I didn’t understand the basics.  
I plan to add the results later.

---

<div class="post-metadata">

**Author:** ![hiroaki\_ohkawa](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hiroaki_ohkawa/32/72678_2.png) [@hiroaki\_ohkawa](https://community.auth0.com/u/hiroaki_ohkawa)\
**Post date:** [February 6, 2025, 2:07pm UTC](https://community.auth0.com/t/how-to-access-event-secrets-in-auth0-actions-are-there-any-differences-between-node-js-versions/181578/3 "2025-02-06T14:07:49Z")

</div>

After modifying the settings, the behavior is now the same for the two tenants.

It’s written in the part `Add a Secret` of the official documentation `Write Your First Action` .

I didn’t understand this mechanism.

And after this understanding, I confirmed the `Secrets` in post-login action of the two tenants.

1. tenant A

- found `client_secret` in `Secrets`

1. tenant B

- Not registered `client_secret` in `Secrets`

This meant that the previous developer had registered with A, but not with B.

I registered client\_secret in B and the result was as expected.

My lesson is to understand the basics well before seeking help.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [February 6, 2025, 3:32pm UTC](https://community.auth0.com/t/how-to-access-event-secrets-in-auth0-actions-are-there-any-differences-between-node-js-versions/181578/4 "2025-02-06T15:32:02Z")

</div>

Hi @hiroaki_ohkawa

Welcome to the Auth0 Community!

Thank you for sharing the solution with other folks! There’s always room for questions, and I’m glad you found the answer and shared it. Team work! 🤝

Thanks  
Dawid

---

<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:** [February 20, 2025, 3:32pm UTC](https://community.auth0.com/t/how-to-access-event-secrets-in-auth0-actions-are-there-any-differences-between-node-js-versions/181578/5 "2025-02-20T15:32:26Z")

</div>

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