React-Native app


#1

I am planning on using Reaction Commerce. But, first I would like to know if it offers some sort of API, to plug-in a mobile app. In this case I am planning on using React-Native to build the apps.

Ideally a Websocket connection, but others are possible: https://facebook.github.io/react-native/docs/network.html


#2

Reaction exposes its entire API using Meteor’s DDP protocol (websockets). Literally 100% of what you can do in the Reaction UI can be done from any other UI via DDP. That includes calling Meteor methods, accessing data publications, and accessing/manipulating database collections (see connection argument). Also worth checking out… https://github.com/ongoworks/meteor-ddp-login/


#3

So from your external app, you could do something like:

// establish a remote DDP connection
const Reaction = DDP.connect('https://my-reaction-site.com/');

// Now you can...

// Methods
Reaction.call('anyReactionMethod', methodArgs, callback);

// Pub/Sub
Reaction.subscribe('anyReactionPublication');

// Collections
const MyCollection = new Mongo.Collection('anyReactionCollection', {
  connection: Reaction
});

#4

Also see:


#5

Cool! I’ll start working from here!


#6

any plans to open-source it? ))