SDK Reference
Methods
GetNotifications

getNotifications

Returns an array of notifications for the currently authenticated user (DID).

The user must have an active session for this query to work.

How to use?

const { data, error } = await orbis.getNotifications(options);

Parameters

  • options - object with the parameters used to retrieve notifications
    • type - string type of notifications to retrieve
      • social - mentions, likes, replies, etc
      • messages - unread messages
    • context - string The context for which you want to view notifications
    • include_child_contexts - boolean Set to true if you also want to retrieve notifications from sub-contexts

Returns

[
    {
        content: {},
        family: "string",
        status: "new" || "viewed",
        type: "social" || "messages",
        user_notifiying_details: {},
        post_details?: {}
    },
    ...
]

Examples

Query notifications from the Global Feed

/** To query the feed notifications for the connected user */
const { data, error } = await orbis.getNotifications({ type: 'social' });

Query notifications scoped to a Context

/** To query the notifications for the connected user in a specific context */
const { data, error } = await orbis.getNotifications({
  type: 'social',
  context: 'kjzl6cw---xejbmcp'
});