UPDATE 10/25/16: Added several new features to the enrich tool!

Bonsai Sketch

While Stormpath is great for storing user accounts — did you know you can also store custom data for each user? Stormpath’s custom data makes it possible to store rich profile data and other information on a user account.

Earlier this week I sat down and built a new tool, stormpath-enrich, using our brand new Node Library.

enrich is a simple Node.js command line tool which analyzes your Stormpath user accounts, finds a plethora of information on each user (by email address), then stores this data in your user account’s custom data store.

enrich makes it incredibly easy to build rich user profiles automatically!

Enrich Your User Accounts

Let’s take a look at what enrich actually does!

Let’s say you’ve got a Stormpath Application with several user accounts, one of which has an email address, [email protected].

When you run enrich, it’ll go through each user account, and do several things:

  • Grab the user’s email address.
  • Use FullContact‘s API service to search for publicly available information on this user.
  • Store whatever information is available in your Stormpath user account’s custom data store — so you can access it later.

FullContact is an extremely useful API service which scours the web for information about users by email address — it will scrape information from Facebook, Twitter, Google, etc., and return a single record with all of the user’s information.

When I run enrich on my personal account, I get the following custom data stored in my user account:

As you can see, enrich was able to grab a LOT of information about me, based
solely on my email address!

Enriched Data

By default, enrich will attempt to grab several data points for each user you have:

  • photos
  • contactInfo
  • organizations
  • demographics
  • socialProfiles

Depending on the what’s publicly available, some of these sections may not be available. When I ran a test on our Stormpath employees, I was able to find a lot of information on just about every person here!

Why Enrich Your Users?

Enrich allows you to customize your user experience very easily. Let’s say I wanted to build a very simple SaaS application — using enrich I’d be able to:

  • Register a new user with only an email address and password.
  • Automatically find this user’s avatar, and use it in my interface to help give my dashboard a more personalized feel.
  • Automatically find this user’s first and last name to greet them (“Welcome back, Randall!”).
  • Integrate deographic information like age, gender, and location into my analytics.
  • Figure out what organization this user is associated with (maybe they’re the CEO of a huge company, and you should email them directly!).

Using Enrich

Using enrich is simple.

First, you’ll need to install npm, the Node.js package manager. Once npm is installed, you can then install enrich by running:

Next, you’ll need to have two accounts:

After you’ve created your accounts, and have your API keys, all you have to do to configure enrich is run:

And you will be prompted to enter your credentials.

Once that’s done, just run:

And your user accounts will be automatically enriched!

NOTE: For best results, I recommend running enrich on a cron job periodically, this way you’ll continuously update your user accounts with the latest available information.

Thoughts, Feedback?

If you’ve got any thoughts or feedback, I’d love to hear it! Please leave a comment below, or drop me a line.