// Authenticating the User [ RLMSyncUser logInWithCredentials :[ RLMSyncCredentials credentialsWithGoogleToken : @"google token" ] authServerURL: [ NSURL URLWithString : @"http://realm.example.com:9080" ] onCompletion: ^ ( RLMSyncUser * user , NSError * error ) { if ( user ) { // Opening a remote Realm NSURL * realmURL = [ NSURL URLWithString : @"realm://realm.example.com:9080/~/userRealm" ]; RLMRealmConfiguration * config = [[ RLMRealmConfiguration alloc ] init ]; config . syncConfiguration = [ user configurationWithURL : realmURL ]; RLMRealm * realm = [ RLMRealm realmWithConfiguration : config error : nil ]; // Any changes made to this Realm will be synced across all devices! } else if ( error ) { // handle error } }];

// Authenticating the User SyncUser . logIn ( with : . google ( token : "google token" ), server : URL ( string : "http://realm.example.com:9080" ) ! ) { user , error in if let user = user { // Opening a remote Realm let realm = try! Realm ( configuration : user . configuration ()) // Any changes made to this Realm will be synced across all devices! } else if let error = error { // handle error } }

// Authenticating the User User user = User . login ( Credentials . google ( "google token" ), "http://realm.example.com:9080/auth" ); // Opening a remote Realm String realmURL = "realm://realm.example.com:9080/~/userRealm" ; Realm realm = Realm . getInstance ( user . getDefaultConfiguration ()); // Any changes made to this Realm will be synced across all devices!

// Authenticating the User Realm . Sync . User . registerWithProvider ( ' http://realm.example.co:9080 ' , ' google ' , googleAccessToken , ( error , user ) => { if ( ! error ) { // Opening a remote Realm var realm = new Realm ({ sync : { user : user , url : ' realm://realm.example.co:9080/~/userRealm ' , } }); // Any changes made to this Realm will be synced across all devices! } })