Create Realm with JavaScript


#1

hi,
Is it somehow possible to create realms with just JavaScript without ReactNative?
I have a iOS-App and a web interface with graphql. But now I would like to create realms like I do it on the iOS-App. I guess with graphql its not possible to create a new realm. So i saw the instructions on this site: https://realm.io/docs/javascript/latest/

but it seems it only works when I install ReactNative as well?

thank you


#2

It’s super simple. You can just use node.js :slight_smile:


#3

sounds good, but how I can overcome the dependency to react-native?

This dependency was not found:

  • react-native in ./node_modules/realm/lib/browser/index.js

#4

@rouuuge Sounds like you are compiling a project on a particular platform? Here is an example server-side Realm app that is run in node and does not require react native


#5

yes I use vueJS with webpack. so if I understand you, its not possible to use realm javascript without a server-side realm app that run in node?

or is it somehow possible to create a new realm with graphql?


#6

@rouuuge

so if I understand you, its not possible to use realm javascript without a server-side realm app that run in node?

that is correct. While technically you can create a realm with GraphQL you cannot instantiate a schema so its use is limited. Once the Realm is created you can then connect with GraphQL from a web browser.