nodeJS GRPC Producer

nodeJS GRPC Producer

Producing Facts via nodeJS is very simple due to the available gRPC NPM Module. It will generate a stub constructor called RemoteFactStore from our proto file.

const uuidV4 = require('uuid/v4');
const grpc = require('grpc');
const protoDescriptor = grpc.load('./FactStore.proto');
const RemoteFactStore =;

// store allows us to publish, subscribe and fetchById (see proto file)
const store = new RemoteFactStore('localhost:9090', grpc.credentials.createInsecure());

  header: JSON.stringify({
    id: uuidV4(),
    ns: 'myapp'
  payload: JSON.stringify({
}], (err, feature) => {
  if (err) {

See the Facts page for detailed information about all possible and required header fields.