If your program is saying "Please initialize first" , you need to run the function KeyAuthApp.init(); on program load. You must add this function before any other functions. If you multiple different classes in your program, make sure you reference the KeyAuthApp instance from the first instance and do not create brand new instances in every class. i.e. Login.KeyAuthApp.userdata.username to reference the instance from the class it was created in, Login.