@nymeria/nymeria-js

1.1.2 • Public • Published

Nymeria

NPM Version

The official npm package to interact with the Nymeria's service. Nymeria works in the browser and in Node itself. This package can be used to verify email addresses, enrich profiles with contact information such as email addresses, phone numbers and social links.

The npm package wraps Nymeria's public API so you don't have to.

Nymeria makes finding contact details a breeze.

Browser

You can leverage unpkg to use Nymeria in the browser. This method should be used with caution. Do not expose your Nymeria API key to end users. Use this method if the environment is in your control or you have a secure method of transferring the API key to your client.

Installation

<script src="https://unpkg.com/@nymeria/nymeria-js@latest/dist/index.js"></script>

Usage

You can then use Nymeria within your webpage, browser plugin, electron app, etc. For example:

let client = nymeria('YOUR API KEY GOES HERE');

client.person.enrich({ profile: 'github.com/nymeriaio' }).then(function (resp) {
    console.log(resp.data.emails);
    console.log(resp.data.phone_numbers);
    console.log(resp.data.profiles);
});

client.email.verify('dev@nymeria.io').then(function (resp) {
    if (resp.data.result === 'valid') {
      console.log('Email is valid!');
    }
});

Errors can be caught and handled.

let client = nymeria('YOUR API KEY GOES HERE');

client.person.enrich({ profile: 'github.com/nymeriaio' }).then(function (resp) {
    console.log(resp.data.emails);
    console.log(resp.data.profiles);
}).catch( resp => {
  if (resp && resp.error) {
    console.log(`Looks like an error happened: ${resp.message} -> more details: ${resp.developers}`)
  }
});

Node

All actions that interact with the Nymeria service assume an API key has been set and will fail if a key hasn't been set. A key only needs to be set once and can be set at the start of your program.

Installation

npm install @nymeria/nymeria-js

Usage

let nymeria = require('@nymeria/nymeria-js');

let client = nymeria('YOUR API KEY GOES HERE');

client.person.enrich({ profile: 'github.com/nymeriaio' }).then(function (resp) {
    console.log(resp.data.emails);
    console.log(resp.data.phone_numbers);
    console.log(resp.data.social);
});

client.email.verify('bill@microsoft.com').then(function (resp) {
    if (resp.result === 'valid') {
      console.log('Email is valid!');
    }
});

Verifying an Email Address

You can verify the deliverability of an email address using Nymeria's service. The response will contain a result and tags.

The result will either be "valid" or "invalid". The tags will give you additional details regarding the email address. For example, the tags will tell you if the mail server connection was successful, if the domain's DNS records are set up to send and receive email, etc.

Enriching Profiles

You can enrich profiles using a number of different parameters:

  1. profile (address of a person's social media profile, like LinkedIn, Twitter, Facebook or Github)
  2. email (a person's email address)
  3. identifier (a numeric identifier, such as a LinkedIn member ID lid:12345 or a Facebook ID fid:12345)

You can specify more than one parameter for each enrichment lookup. For example,

let nymeria = require('@nymeria/nymeria-js');

let client = nymeria('YOUR API KEY GOES HERE');

client.person.bulk_enrich([{ profile: 'github.com/nymeriaio', email: 'someone@nymeria.io', lid: '12345' }]).then(function (resp) {
  resp.forEach((r) => {
    console.log(r.data.emails);
    console.log(r.data.phone_numbers);
    console.log(r.data.social);
  })
});

At this time, Nymeria supports look ups for the following sites:

  1. LinkedIn
  2. Facebook
  3. Twitter
  4. GitHub

Please note, if using LinkedIn urls provide the public profile LinkedIn url.

Two other common parameters are filter and require. If you wish to filter out professional emails (only receive personal emails) you can do so by specifying "professional-emails" as the filter parameter.

The require parameter works by requiring certain kinds of data. For example, you can request an enrichment but only receive a result if the profile contains a phone number (or an email, personal email, professional email, etc). The following are all valid requirements:

  1. "email"
  2. "phone"
  3. "professional-email"
  4. "personal-email"

You can specify multiple requirements by using a comma between each requirement. For example you can require a phone and personal email with: "phone,personal-email" as the require parameter.

Searching for People

let nymeria = require('@nymeria/nymeria-js');

let client = nymeria('YOUR API KEY GOES HERE');

client.person.search({ query: 'skills:"Ruby on Rails"' }).then(people => {
  let ids = [];

  people.forEach(person => {
      ids.push(person.data.id);
  });

  // Do something...
});

By default, 10 people will be returned for each page of search results. You can specify the page as part of your object if you want to access additional pages of people.

You can filter the search results and if you want to reveal the complete details you can do so by sending the uuids via reveal. Please note, credit will be consumed for each person that is revealed.

License

MIT

Package Sidebar

Install

npm i @nymeria/nymeria-js

Weekly Downloads

49

Version

1.1.2

License

MIT

Unpacked Size

134 kB

Total Files

5

Last publish

Collaborators

  • nymeria