1

This may seem trivial, but I have been unsuccessful at getting this to work. I have used UserApp.io successfully for user/authentication management. I recently created an ember app using ember-cli, but I am unable to get the two to work together despite ember being supported by UserApp.io. Here are there instructions (integrating with ember without cli).

https://github.com/userapp-io/userapp-ember

Here is a snippet:

Include the UserApp JavaScript library and this Ember module in your index.html. Be sure to add them before your app.js file.

<script src="https://app.userapp.io/js/userapp.client.js"></script>
<script src="https://app.userapp.io/js/ember-userapp.js"></script>

(You can also install the module with bower: $ bower install userapp-ember)

Initiate the module

Add this code above App = Ember.Application.create(); in app.js with your App Id.

Ember.Application.initializer({
    name: 'userapp',
    initialize: function(container, application) {
        Ember.UserApp.setup(application, { appId: 'YOUR-USERAPP-APP-ID' });
    }
});

Because I am using ember-cli I have created a file called userapp.js in an initializers folder which has the following code:

import Ember from 'ember';

export default {
    name: 'userapp',
    initialize: function(container, application) {
        Ember.UserApp.setup(application, { 
            appId: 'USERAPP-ID-INSERTED-HERE',
            loginRoute: 'login',
            indexRoute: 'index',
            heartbeatInterval: 20000,
            usernameIsEmail: false
        });
    }
};

When I run my app I get the following error:

Uncaught TypeError: Cannot read property 'setup' of undefined

I feel like this is something simple/stupid, but for the life of me I cannot figure this one out.

molligan
  • 35
  • 3
  • It seems ember-userapp.js is not getting included in ur app. Can you confirm if it is included. If you are using bower to install it, edit the Brocfile.js to include the lib like app.import('bower_components/userapp-ember/ember-userapp.js'); Its mentioned here http://www.ember-cli.com/#standard-non-amd-asset – blessanm86 May 02 '15 at 11:21
  • Thanks! That did the trick. I figured it was something trivial. – molligan May 02 '15 at 15:27

1 Answers1

0

It seems ember-userapp.js is not getting included in ur app. If you are using bower to install it, edit the Brocfile.js to include the lib like

app.import('bower_components/userapp-ember/ember-userapp.js');

Its mentioned here http://ember-cli.com/#standard-non-amd-asset

blessanm86
  • 31,439
  • 14
  • 68
  • 79