Error implementing library managment API v2


I am using quasar framework to develop a SPA.
In order to use Management API v2 explained here I install auth0 using shell “npm install --save auth0” in addition I call Auth0 Management API with “var ManagementClient = require(‘auth0’).ManagementClient;” which is the simplest part of documentation.

After that, there are some compile errors.
"Failed to compile with 4 errors
This dependency was not found:

  • dns in ./node_modules/pac-resolver/dnsResolve.js, ./node_modules/pac-resolver/isInNet.js and 2 others"

I try to resolve this with “npm install --save dns” but I receive more errors “Error: Cannot find module ‘net’ at webpackEmptyContext”.

The dependencies in package.json are
“dependencies”: {
@auth0/auth0-spa-js”: “^1.8.1”,
@quasar/extras”: “^1.0.0”,
“auth0”: “^2.26.0”,
“axios”: “^0.18.1”,
“quasar”: “^1.0.0”,
“vue-i18n”: “^8.0.0”,
“vue-page-transition”: “^0.2.2”

The library @auth0/auth0-spa-js is to handle the login and the library auth0 that has just been installed, is to manager users data.

Can anyone through light to this issue?
Thanks in advance.

Hi @Rub32,

Welcome to the Community.

What are you trying to do with the management API? Auth0 automatically limits what scopes a SPA can request from the management API. The node-auth0 library is not intended for use in a single page app, and this could explain some of the complications you are running into.

If you want to build out a way for users to manage their own profiles, we recommend doing so through a proxy API. Here is an example of how to set up a flow for a user to change their email:

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