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, r@rdegges.com.
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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
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:
1
|
|
Next, you’ll need to have two accounts:
- A Stormpath account (if you don’t already have one), and a
- FullContact developer account.
After you’ve created your accounts, and have your API keys, all you have to do
to configure enrich
is run:
1
|
|
And you will be prompted to enter your credentials.
Once that’s done, just run:
1
|
|
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.