auth0/zerocrm-middleware

Name: zerocrm-middleware

Owner: Auth0

Description: Middleware for the Auth0 Extend ZERO CRM sample

Created: 2017-10-24 18:06:17.0

Updated: 2017-10-24 19:10:14.0

Pushed: 2017-10-24 19:49:10.0

Homepage: null

Size: 7

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

zerocrm-middleware

Middleware for the Auth0 Extend ZERO CRM sample

Overview

This middleware offers a custom programming model for the ZERO CRM application. It allows users to author extensions using a programming model of: function (lead, cb) and to access secrets globally.

Here is example illustrating using the Clearbit SDK to look up a lead.

clearbit = require('clearbit')(module.exports.secrets.clearbit_key);

le.exports = function(lead, cb) {
nsole.log(lead.email);

r Person = clearbit.Person;
rson.find({email: lead.email}).
then(person=> {
  lead.github = person.github.handle;
  lead.twitter = person.twitter.handle;
  lead.linkedin = person.linkedin.handle;
  console.log(lead);
  cb(null, lead);
});

License

Apache 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.