@fr33m0nk/clearbit-client
v2.0.3
Published
Clearbit API client
Downloads
10
Maintainers
Readme
Clearbit Client (Typescript/Javascript)
- This client library supports the latest
v2
API for Clearbit - 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
Combined query (Person + Company) API
import {combinedQuery, CombinedQueryParams, PersonAndCompany} from "./index";
const queryParams: CombinedQueryParams = {email: "[email protected]"}
combinedQuery("API_KEY")(queryParams).then((r: PersonAndCompany) => {
console.log("\n Yay Combined Search\n")
console.log(r)
console.log("\n ------- \n")
}).catch((error) => {
console.log("\n Nay Combined Search\n")
console.log(error)
})
Person query API
import {personQuery, PersonQueryParams, Person} from "./index";
const queryParams: PersonQueryParams = {email: "[email protected]"}
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)
})
Company query API
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)
})