# Actions: How do I \*set\* an event.user.nickname?

**URL:** <https://community.auth0.com/t/actions-how-do-i-set-an-event-user-nickname/118266>\
**Category:** Get Help\
**Tags:** other-built-in-social-connections, connections\
**Created:** [October 11, 2023, 7:54am UTC](https://community.auth0.com/t/actions-how-do-i-set-an-event-user-nickname/118266 "2023-10-11T07:54:28Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![gparascandolo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gparascandolo/32/38788_2.png) [@gparascandolo](https://community.auth0.com/u/gparascandolo)\
**Post date:** [October 11, 2023, 6:58pm UTC](https://community.auth0.com/t/actions-how-do-i-set-an-event-user-nickname/118266/5 "2023-10-11T18:58:36Z")

</div>

Hey @edent

I took a closer look at the older post you made, are you looking to just temporarily override the `nickname` field for the ID Token on the frontend or the Access Token for the `/userinfo` endpoint?

I haven’t tested this, but try setting the nickname via the built-in api `setCustomClaim` functions.

```auto
exports.onExecutePostLogin = async (event, api) => {
  // Put the user screen_name as the nickname
  // for Twitter connections
  if (event.connection.name === 'twitter' && event.user.screen_name) {
    api.idToken.setCustomClaim('nickname', event.user.screen_name);
    api.accessToken.setCustomClaim('nickname', event.user.screen_name);
  } 
};

```

Generally you would create a custom claim in the tokens with a namespace you own, but give this a try and see if this will resolve your issue.

---

_[View the full topic](https://community.auth0.com/t/actions-how-do-i-set-an-event-user-nickname/118266)._
