Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

fr33m0nk/lusha-client

Repository files navigation

  • This client library supports the latest API from Lusha
  • This client uses Effect library. Effect is definitely worth looking into.
  • However, it exposes the Promise based functions for usage
  • If there is a demand, I will expose Effect based functions in later releases.

Usage

import {personQuery, PersonQueryParams, Person} from "./index";

const queryParams: PersonQueryParams = {
    firstName: "James", 
    lastName: "Bond",
    company: "British"
}

personQuery("API_KEY")(queryParams).then((r: Person) => {
  console.log("\n Yay Person Search \n")
  console.log(r)
  console.log("\n ------- \n")
}).catch((error) => {
  console.log("\n Nay Person Search \n")
  console.log(error)
})
import {companyQuery, CompanyQueryParams, Company} from "./index";

const companyQueryParams: CompanyQueryParams = {domain: "google.com"}

companyQuery("API_KEY")(companyQueryParams).then((r: Company) => {
  console.log("\n Yay Company Search \n")
  console.log(r)
  console.log("\n ------- \n")
}).catch((error) => {
  console.log("\n Nay Company Search \n")
  console.log(error)
})