Do Actions still not support ESM?

Ready to post? :mag: First, try searching for your answer.
Hello,

I’m looking into creating an onExecutePostLogin action and was wondering if I’m able to use ESM for this?

import { ManagementClient } from 'auth0';

/**
 * Handler that will be called during the execution of a PostLogin flow.
 *
 * @param {Event} event - Details about the user and the context in which they are logging in.
 * @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
 */
export async function onExecutePostLogin(event, api) {}

I see on the auth0-node library that ESM is currently supported, was wondering if that translates to Actions?

Also, will you be moving to latest node LTS anytime soon?

Thanks!

I’m also a bit confused as I see this in the Actions editor which seems to imply Typescript is supported:

But then here in Actions limitations, it says Typescript is not supported:

1 Like

Hi @brett.rogerson,

Welcome to the Auth0 Community.

If you want to use Node.js modules you will first need to add them to your dependencies in your action and then add it in your code using the require() method.

Example:

exports.onExecutePostLogin = async (event, api) => {
  const ManagementClient = require('auth0').ManagementClient;
}

About the tutorial message saying that Typescript is supported, I’ve just tested it myself, Typescript is not supported. I’m not sure why it’s saying it is. I will have to bring it up internally.

If you have any other question for us feel free to let us know.

Have a good one,
Vlad

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