Typescript client for hackerAPI.
To install, use npm:
npm install @hackmcgill/hackerapi-client-ts
At the entry-point of your code, you must provide the endpoint of the API:
import { api as API } from '@hackmcgill/hackerapi-client-ts';
API.setURL('https://api.mchacks.ca');
Afterwards, you can use whichever resource you would like. For example, you can create an Account as such:
import { Account } from '@hackmcgill/hackerapi-client-ts';
Account.create({
accountType: UserType.HACKER;
confirmed: true;
firstName: 'John';
lastName: 'Doe';
email: '[email protected]';
dietaryRestrictions: ['Halal', 'Vegetarian'];
shirtSize: ShirtSize.XL;
password: 'hunter2';
phoneNumber: '1234567889';
birthDate: '2008-09-15T15:53:00';
pronoun: 'He / him';
id: '';
});
Documentation on the different routes can be found here.
Usage in a real-life repository can be found here.
If you have questions about how to use this, shoot an email to [email protected], or create an Issue.