ashbyhq
v1.0.1
Published
TypeScript client for AshbyHQ API
Maintainers
Readme
AshbyHQ API Client
A TypeScript client library for interacting with the AshbyHQ API. This client provides a type-safe way to interact with Ashby's recruitment and applicant tracking system API.
Features
- 🔒 Type-safe API interactions
- 📦 Modern TypeScript/JavaScript support
- 🚀 Promise-based async/await interface
- 📝 Comprehensive type definitions
- 🛠️ Built with Axios for reliable HTTP requests
Installation
npm install ashbyhq-client
# or
yarn add ashbyhq-clientProject Structure
src/
├── client/ # Core client implementation
├── enums/ # Enumeration types
├── services/ # Service-specific implementations
├── types/ # TypeScript type definitions
└── index.ts # Main entry pointUsage
import { AshbyClient } from 'ashbyhq-client';
// Initialize the client with API key
const client = new AshbyClient({
auth: {
apiKey: 'your_api_key_here'
}
});
// Or initialize with username and password
const clientWithCredentials = new AshbyClient({
auth: {
username: 'your_username',
password: 'your_password'
}
});
// Optional configuration
const clientWithConfig = new AshbyClient({
auth: {
apiKey: '' // Token auth
username: '', // Basic Auth
password: '', // Basic Auth
},
baseURL: 'https://api.ashbyhq.com', // Optional: defaults to this URL
timeout: 10000, // Optional: defaults to 10000ms
headers: { // Optional: additional headers
'Custom-Header': 'value'
}
});
// Create a new candidate
const createCandidate = async () => {
const candidate = await client.candidate.create({
firstName: 'John',
lastName: 'Doe',
email: '[email protected]',
title: 'Software Engineer',
company: 'Previous Company',
location: 'New York, NY'
});
console.log('Created candidate:', candidate);
};API Reference
Candidates
candidate.create(input: CreateCandidateInput): Promise<CandidateResponse>
Creates a new candidate in Ashby.
Input Parameters
firstName(required): Candidate's first namelastName(required): Candidate's last nameemail(optional): Candidate's email addressphone(optional): Candidate's phone numbertitle(optional): Candidate's current titlecompany(optional): Candidate's current companylocation(optional): Candidate's locationlinkedInUrl(optional): Candidate's LinkedIn profile URLgithubUrl(optional): Candidate's GitHub profile URLportfolioUrl(optional): Candidate's portfolio URLsource(optional): Source of the candidatenotes(optional): Additional notes about the candidatecustomFields(optional): Any custom fields defined in your Ashby instance
Development
To build the project:
npm run buildTo run tests:
npm testDependencies
axios: HTTP client for making API requeststypescript: For type definitions and compilationts-node: For running TypeScript files directly
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Security
⚠️ Never commit your API key to version control. Always use environment variables or secure secret management solutions.
Support
For issues and feature requests, please open an issue on the GitHub repository.
