Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import { api, utils, NotificationItem } from "@epnsproject/frontend-sdk"
// Define the variables required to make a request
const walletAddress = "0x1234567890abcdcdefghijklmnopqrstuvwxyz123";
const pageNumber = 1;
const itemsPerPage = 20;
// Fetch the notifications
const fetchedNotifications = await api.fetchNotifications(walletAddress, itemsPerPage, pageNumber)
console.log(fetchedNotifications);
// Parse the notification fetched
const parsedResponse = utils.parseApiResponse(fetchedNotifications.results);
console.log(parsedResponse);
// This is used to render the text present in a notification body as a JSX element
<NotificationItem
notificationTitle="NOTIFICATION TITLE"
notificationBody="NOTIFICATION BODY EXAMPLE"
cta="www.cta.com"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment