📬 Lightweight (<3KB) Wrapper around the GitHub Notifications API
# Using npm
npm install gh-notifications
# Using yarn
yarn add gh-notifications
Warning: Usage of gh-notifications requires a valid github api token: Documentation
const APITOKEN = "**************";
async function main() {
// get a GitHubInbox instance and pass the api token to it
const inbox = new GitHubInbox(APITOKEN);
// initialize the inbox
await inbox.initialize();
// fetch all unread notifications
const unreadNotifications = await inbox.fetchUnreadNotifications();
// view src/types.ts for all fields in the notification object
console.log(unreadNotifications);
// mark the latest unread notification as read
await inbox.markAsRead(unreadNotifications[0]?.id);
}
main();
Published under MIT - Made with ❤️ by Conner Bachmann