personality

User profiles with persona, without storing e-mails

Layer on top of node.js to deal with user profiles in persona. Inspired in great deal by node-prohibition (code looks rather similar).

Stores emails in SHA1 so you never actually store the email.

The purpose of this is to avoid Privacy Terms/Policy. If you need the email you can just ask the user for it. This is intended for apps that do NOT require emails to work.

  • Display names are not unique(1)
  • Might be broken somewhere, open an issue if so! =)

(1) Can be solved by storing a list of used display names

MIT License

{
    "hash": "6cceece8d166ad4e99ee0fe8a56cf06f2896a00c",
    "display": "rsole",
    "systemData": {
        "joined": "1384302755",
        "updated": "1384302755"
    }
}
$ npm install
var Personality = require('personality');
 
var personality = new Personality({
  meta: {
    age: null,
    city: null
  },
  db: './db'
});

meta is a list of extra fields you'd like to use in your api (optional).

db is the path where your leveldb database is located (mandatory).

var profile = {
  hash: 'ricard@sole.ca',
  display: 'rsole'
};
 
personality.create(profile, function (errp) {
  if (!err) {
    console.log(p);
  }
});
personality.get('6cceece8d166ad4e99ee0fe8a56cf06f2896a00c', function (errp) {
  if (!err) {
    console.log(p);
  }
});
var profile = {
  display: 'rsole_',
  meta: {
    city: 'Barcelona'
  }
}
personality.update(profile, '6cceece8d166ad4e99ee0fe8a56cf06f2896a00c', function (errp) {
  if (!err) {
    console.log(p);
  }
});
personality.del('6cceece8d166ad4e99ee0fe8a56cf06f2896a00c', function (err) {
  if (!err) {
    console.log('deleted!');
  }
});