# Actions don't support ESM?

**URL:** <https://community.auth0.com/t/actions-dont-support-esm/105276>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [April 21, 2023, 10:51pm UTC](https://community.auth0.com/t/actions-dont-support-esm/105276 "2023-04-21T22:51:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![botsko](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/botsko/32/45133_2.png) [@botsko](https://community.auth0.com/u/botsko)\
**Post date:** [April 21, 2023, 10:51pm UTC](https://community.auth0.com/t/actions-dont-support-esm/105276/1 "2023-04-21T22:51:40Z")

</div>

I’m trying to setup my first action but it seems like they don’t allow importing ESM modules.

```auto
//const ky = require('ky') // errors because ky is an esm module
import ky from 'ky' // errors because action is not running inside a type: package

exports.onExecutePostUserRegistration = async (event, api) => {
  const HOOK_URL = 'abc.com'
  const SECRET = event.secrets.AUTH0_HOOK_SECRET
  
  const json = await ky.post(HOOK_URL, {json: { user: event.user, secret: SECRET }}).json();
}

```

Am I unable to use any ESM packages?

I just switched to AXIOS which works fine. We use ky in our app so it’d be nice to stay consistent.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [April 24, 2023, 7:02pm UTC](https://community.auth0.com/t/actions-dont-support-esm/105276/3 "2023-04-24T19:02:54Z")

</div>

Hi @botsko.

Welcome to the Auth0 Community!

Unfortunately, the `ky` module is not currently supported with using Auth0 Actions.

A full list of available modules can be found here:  
[https://auth0-extensions.github.io/canirequire/](https://auth0-extensions.github.io/canirequire/)

In this scenario, I recommend using the **Axios** package to make an HTTP Post request in a Post-User Registration Action.

I hope this helps!

Please let me know if you have any additional questions.

Thanks,  
Rueben

---

<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:** [May 8, 2023, 7:03pm UTC](https://community.auth0.com/t/actions-dont-support-esm/105276/4 "2023-05-08T19:03:36Z")

</div>

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