/Epnsfrontendintegration Secret
Created
March 23, 2022 00:13
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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