DEV Community

Discussion on: MongoDB Atlas Hackathon Help Thread

Collapse
 
joellord profile image
Joel Lord

Hi,

For more technical questions, you might want to try to search or post on our community forums (mongodb.com/community/forums/), you will normally get a quicker answer there. As for your question, you could try creating an object that contains your application, and then use the methods for this application. Right now, I’m not sure if your Realm.app is an initialized property. You could try this out:

const app = new Realm.App({ id: "<APP_ID>" });
const credentials = Realm.Credentials.emailPassword(email, password);
const user = await app.login(credentials);
const userProfile = app.currentUser;
const userId = app.currentUser.id;
Enter fullscreen mode Exit fullscreen mode

I hope this helps!