JavaScript SDK

Getting started with the People Data Labs JavaScript Helper Library, which is our open-source SDK that lets you write JavaScript code to make HTTP requests to the People Data Labs API

The People Data Labs JavaScript Helper Library

The People Data Labs JavaScript Helper Library makes it easy to interact with the People Data Labs API from your JavaScript application. You can find the most recent version of the library on npm.

Install the library

This library is available as an NPM package, and you can install it with:

npm i -S peopledatalabs
yarn add peopledatalabs

Using the library

import PDLJS from 'peopledatalabs';

const PDLClient = new PDLJS({ apiKey: YOUR_API_KEY });

// Chaining Implementation
PDLJS.person.enrichment({ profile: 'linkedin.com/in/seanthorne' }).then((response) => {
  console.log(response?.data);
}).catch((error) => {
  console.log(error);
});

// Async/Await Implementation
try {
  const getPersonRecord = async () => {
    const response = await PDLJS.person.enrichment({ profile: 'linkedin.com/in/seanthorne' });
    console.log(response?.data);
  }
  
  getPersonRecord();
} catch (error) {
  console.log(error);
}

TypeScript Support

The People Data Labs JavaScript SDK ships with TypeScript types, so you can use it to gain the benefits from TypeScript without having to write your own types.

More Information, Pull Requests, Feature Suggestions and Bug Reports

We've open-sourced the library, which is available on GitHub. Head there to view more information and submit pull requests, feature suggestions or bug reports.


Did this page help you?