Auth0 Home Blog Docs

Implement login in phonegap build



I try to make a login in phonegap build, but I have problems with the library auth0-cordova.
I make a "npm install @ auth0 / cordova"
I copy the files from that library to the app.
I add them to the index.html of the app
I make a

var Auth0Cordova = require ('@ auth0 / cordova');

function main () {
     function handlerUrl (url) {
         Auth0Cordova.onRedirectUri (url);
     window.handleOpenURL = handlerUrl;
     // init your application

document.addEventListener ('deviceready', main);

But it says “require is not defined” when testing it on a real device


I confess I have no experience with PhoneGap builds, but the error in question seems to be irrelevant of the library in question; or said it another way it seems it would also fail if you were requiring any other library. I would personally do the test with a general library and if the error is the same would post this question in a more general forum like StackOverflow as it would increase the likelyhood of being reviewed by PhoneGap experts.