# Implement login in phonegap build

**URL:** <https://community.auth0.com/t/implement-login-in-phonegap-build/8679>\
**Category:** Get Help\
**Tags:** phonegap, android, authentication\
**Created:** [November 6, 2017, 9:47pm UTC](https://community.auth0.com/t/implement-login-in-phonegap-build/8679 "2017-11-06T21:47:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bo1](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@bo1](https://community.auth0.com/u/bo1)\
**Post date:** [November 6, 2017, 9:47pm UTC](https://community.auth0.com/t/implement-login-in-phonegap-build/8679/1 "2017-11-06T21:47:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [November 7, 2017, 7:17pm UTC](https://community.auth0.com/t/implement-login-in-phonegap-build/8679/2 "2017-11-07T19:17:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/implement-login-in-phonegap-build/8679/3 "2018-03-02T05:57:18Z")

</div>


