hackry v2.0.0
Hackry JavaScript Library
The Hackry JavaScript Library wraps the Hackry REST API for server-side and client-side use. No secrets or other credentials are ever exchanged using this library since all API endpoints interfaced are public.
Documentation
See the Hackry REST API Docs.
Installation
Using npm:
$ npm install hackry
Using CDN:
<script src="https://unpkg.com/hackry"></script>
Usage
Instantiate a Hackry
object with your hackathon id, located in the Home
section of the dashboard.
const hackry = new Hackry('<hackathon-id>', {
// Defaults to true. Set to false for server-side use.
cache: false
});
// Get the attendee registration URL for your hackathon.
hackry.registrationURL();
All hackathon resources have a corresponding method for fetching. Some methods will sort resources to guarantee ordering.
The announcements
and events
methods take an optional query params object
that allows you to format their date response properties according to a
Moment.js format string.
Announcements
Sorted by updatedAt
in ascending order.
hackry.announcements(function(err, announcements) {
});
// Format updatedAt property with Moment.js format string.
hackry.announcements({
timeZone: 'America/New_York',
updatedAtFormat: 'dddd h:mm a'
}, function(err, announcements) {
// Each announcement has updatedAtFormatted property.
});
Day of Contacts
Not sorted.
hackry.dayOfContacts(function(err, dayOfContacts) {
});
Events
Sorted by startDate
in ascending order.
hackry.events(function(err, events) {
});
// Format startDate and/or endDate properties with Moment.js format strings.
hackry.events({
timeZone: 'America/New_York',
startDateFormat: 'dddd h:mm a',
endDateFormat: 'h:mm a'
}, function(err, events) {
// Each event now has startDateFormatted and endDateFormatted properties.
});
FAQs
Sorted by position
in ascending order
hackry.faqs(function(err, faqs) {
});
Troubleshooting
If no resources are returned by a method without an error occuring, make sure you have at least one resource populated in your dashboard with visibility turned on. As explained in the documentation, only objects with an enabled visibility/availability will be delivered.
Contact Us
Please send any questions or feature requests to support@hackry.io.