Skip to main content

Fetch notifications overview

These APIs are useful for fetching list of all notification (inbox or spam) of a user in a paginated manner.

Notification list API

// userAlice.notification.list(type, {options?})
const inboxNotifications = await userAlice.notification.list("INBOX");

Notification list parameters

ParamTypeSubtypeDefaultRemarks
typeINBOX or SPAM-INBOXA string representing the type of feed to retrieve.
optionsobject--An object containing additional options for filtering and pagination.
-options.accountstring-Account supports a number of address format including wallet addresses, chain agnostic wallet addresses, NFT addresses, etc
-options.channelsstring[]-An array of channels to filter feeds by.
-options.pagenumber1A number representing the page of results to retrieve.
-options.limitnumber10A number representing the maximum number of feeds to retrieve per page.
-options.rawbooleanFalseA boolean indicating whether to retrieve raw feed data.

Note: Parameters in this style are mandatory.

Expected response
[
{
cta: "",
title: "test",
message: "test",
icon: "https://gateway.ipfs.io/ipfs/bafybeib76bmkscu6efwawi2tkltdgthwrpny2ok7lur7nltffgydiq7ruy/QmVaY4HQaorrMhKo1sHk7FM1B8Xi1JnT3DvJbG9Xv7VeLZ",
url: "https://google.com",
sid: "1922",
app: "Updated Name",
image: "",
blockchain: "ETH_TEST_GOERLI",
notification: { body: "test", title: "Updated Name - test" },
secret: "",
},
{
cta: "",
title: "test",
message: "test",
icon: "https://gateway.ipfs.io/ipfs/bafybeib76bmkscu6efwawi2tkltdgthwrpny2ok7lur7nltffgydiq7ruy/QmVaY4HQaorrMhKo1sHk7FM1B8Xi1JnT3DvJbG9Xv7VeLZ",
url: "https://google.com",
sid: "1435",
app: "Updated Name",
image: "",
blockchain: "ETH_TEST_GOERLI",
notification: { body: "test", title: "Updated Name - test" },
secret: "",
},
{
cta: "",
title: "test",
message: "test",
icon: "https://gateway.ipfs.io/ipfs/bafybeib76bmkscu6efwawi2tkltdgthwrpny2ok7lur7nltffgydiq7ruy/QmVaY4HQaorrMhKo1sHk7FM1B8Xi1JnT3DvJbG9Xv7VeLZ",
url: "https://google.com",
sid: "1432",
app: "Updated Name",
image: "",
blockchain: "ETH_TEST_GOERLI",
notification: { body: "test", title: "Updated Name - test" },
secret: "",
},
];