I’m trying to setup my first action but it seems like they don’t allow importing ESM modules.
//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.