Space SDK Package

Space SDK Package

  • Users
  • Storage
  • Space Docs

@spacehq/sdk > UserStorage > notificationSubscribe

UserStorage.notificationSubscribe() method

NotificationSubscribe is used to listen for Mailbox events.

It listens to the users mailbox events, enriches the message with Space specific data.

Signature:

notificationSubscribe(): Promise<NotificationSubscribeResponse>;

Returns:

Promise<NotificationSubscribeResponse>

Example

const spaceStorage = new UserStorage(spaceUser);
await spaceStorage.initListener();

const response = await spaceStorage.notificationSubscribe();

response.on('data', (data: NotificationSubscribeEvent) => {
 const { notification: { relatedObject } } = data as Notification;
 console.log('file invitation: ', relatedObject);
});

  • UserStorage.notificationSubscribe() method
  • Example
Space SDK Package
Docs
Getting StartedUsersStorage
Resources
All DocumentationProject SlackBlog
More
GitHubStar
Follow @spacestorage