ashbyhq-client
v1.1.4
Published
TypeScript client for AshbyHQ API
Maintainers
Readme
AshbyHQ API TypeScript Client
A TypeScript client for interacting with the AshbyHQ API. This client provides a simple and type-safe way to interact with AshbyHQ's recruitment platform API.
Installation
npm install ashbyhq-clientUsage
First, initialize the client with your API key:
import AshbyClient from 'ashbyhq-client';
const client = new AshbyClient({
auth: {
apiKey: 'YOUR_API_KEY',
},
});Features
Candidates
- List Candidates
const candidates = await client.candidate.list({
limit: 10,
// Optional parameters:
// cursor: 'string',
// syncToken: 'string',
});- Create a Candidate
const candidate = await client.candidate.create({
name: "John Doe",
email: "[email protected]",
location: {
city: "San Francisco",
region: "CA",
country: "USA"
},
// Optional fields
alternateEmailAddresses: ["[email protected]"],
phoneNumber: "+1234567890",
linkedinUrl: "https://www.linkedin.com/in/johndoe",
githubUrl: "https://www.github.com/johndoe",
website: "https://www.johndoe.com",
sourceId: "source_id",
creditedToUserId: "user_id",
});- Search for a Candidate
const candidate = await client.candidate.search({
email: '[email protected]'
});- Update a Candidate
const updatedCandidate = await client.candidate.update({
candidateId: 'candidate_id',
name: 'John Smith',
email: '[email protected]',
location: {
city: 'San Francisco',
region: 'CA',
country: 'USA'
}
});- Find a Candidate
const candidate = await client.candidate.find({
id: 'candidate_id',
});- Upload Resume
const resume = await client.candidate.uploadResume({
candidateId: 'candidate_id',
resume: File, // File object containing the resume
});Dependencies
- axios: HTTP client for making API requests
- TypeScript: For type safety and better development experience
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
