I am trying to create a user using the managment client sdk , however the error createUser is not a function is being thrown , I did not see anyone else with such an error , so I am not sure what I am doing wrong .
auth0 version → “auth0”: “^4.3.1”,
export const managementClient = new ManagementClient({
domain: process.env.AUTH0_DOMAIN,
clientId: process.env.AUTH0_MANAGEMENT_CLIENT_ID,
clientSecret: process.env.AUTH0_MANAGEMENT_CLIENT_SECRET,
scope: "update:users",
});
async function createUser(user) {
const { email, role, password, ...profile } = user;
const externalData = await managementClient.createUser({ email, password,...DEFAULT_USER_CREATION_PARAMS });
const internalUser = await User.create({
externalId: externalData.user_id,
email: email,
role,
profile,
});
return internalUser;
}