https://github.com/hackmcgill/hackerapi-client-ts
Typescript client for hackerAPI.
https://github.com/hackmcgill/hackerapi-client-ts
api client hackathon registration typescript
Last synced: about 1 month ago
JSON representation
Typescript client for hackerAPI.
- Host: GitHub
- URL: https://github.com/hackmcgill/hackerapi-client-ts
- Owner: hackmcgill
- Created: 2019-02-05T02:16:38.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-05T22:27:40.000Z (almost 6 years ago)
- Last Synced: 2025-03-15T16:36:27.659Z (2 months ago)
- Topics: api, client, hackathon, registration, typescript
- Language: TypeScript
- Size: 54.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hackerAPI-client-ts
Typescript client for [hackerAPI.](https://github.com/hackmcgill/hackerAPI)
## Installation
To install, use npm:
```bash
npm install @hackmcgill/hackerapi-client-ts
```## Usage
At the entry-point of your code, you must provide the endpoint of the API:
```typescript
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:
```typescript
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.](https://docs.mchacks.ca/api/)
## Example usage
Usage in a real-life repository can be [found here.](https://github.com/hackmcgill/hackerAPI-frontend)
## Questions
If you have questions about how to use this, shoot an email to , or create an [Issue.](https://github.com/hackmcgill/hackerAPI-client-ts/issues)