Author

Posted by Madhuram Gupta

3 Comments

  1. Hi. I am doing some research for a project and was wondering if I were to use Couchbase Mobile offline, would it be as simple as just turning on the sync gateway capabilities to sync with Couchbase in the cloud? I would like to provide in-app purchase to allow this capability and the user may have a large dataset by the time they decide to use the cloud syncing capabilities.

    1. You can use Couchbase Lite in standalone mode (as shown in the “standalone tutorial” linked in from this blog)- what that essentially implies is that you will not have the Couchbase Lite replicator setup to sync with Sync Gateway.
      The Sync Gateway will be on and running regardless (so you are not turning on or off the Sync Gateway).
      In your use case, you will control whether or not the client (mobile app with Couchbase Lite) will sync to the Sync Gateway based on whether the user makes the purchase. Once the user makes purchase, you can setup the replicator on Couchbase Lite to start syncing with Sync Gateway. Note that you will have to create the user on the Sync Gateway so it will authorize the sync. So when the in-app purchase is made, you can use the Sync Gateway /user REST endpoint to create the user for instance.

  2. Great. This is what I was looking for! Thanks!

Leave a reply