Home
Notifications

React Component Usage

This is used to automatically embed a notifications component. Based on the params, it will indicate to the user if they already subscribed or not.

api_keyrequired
string

Your developer API-KEY

notification_grouprequired
string

The name of the notification group you created earlier in the Notifiations Dashboard

user_addressrequired
string

The user’s wallet address or other random identifier

size
string

The size of the button - ‘small’ or ‘large’

background
string

The background of the button - ‘black’ or ‘white’

color
string

The color of the button text/icon

onDisabled
function

This function will be called when the user disables notifications

onEnabled
function

This function will be called when the user enables notifications

import {NotificationsButton} from "selfguard-react-components";

<NotificationsButton
    api_key={api_key} 
    notification_group={notification_group} 
    user_address={user_address}
    background={background}
    size={size}
    color={color}
    onDisabled={onDisabled}
    onEnabled={onEnabled}
/>

Bulk Send

This allows you to send notifications to all users of a particular notification group.

Send SMS

notification_grouprequired
string

The group to which you want to send the notification.

textrequired
string

The content of the sms that will be sent out.

await sg.sendBulkSMS({notification_group,text});

Send Email

notification_grouprequired
string

The group to which you want to send the notification.

subjectrequired
string

The subject of the email that will be sent out.

bodyrequired
string

The body of the email that will be sent out.

await sg.sendBulkEmail({notification_group, subject, body});

Individual Send

This allows you to send individual notifications to your users.

Send SMS

user_addressrequired
string

The user’s wallet address or other random identifier

notification_grouprequired
string

The group to which you want to send the notification.

textrequired
string

The content of the sms that will be sent out.

await sg.sendSMS({user_address,notification_group,text});

Send Email

user_addressrequired
string

The user’s wallet address or other random identifier

notification_grouprequired
string

The group to which you want to send the notification.

subjectrequired
string

The subject of the email that will be sent out.

bodyrequired
string

The body of the email that will be sent out.

await sg.sendEmail({user_address,notification_group, subject, body});

Notification Group Management

This allows you to create notifications groups and retrieve them

Create Notification Group

notification_grouprequired
string

The name of the notification group

contract_address
string

A contract address you would like associated with this group. This will later be used to allow you to token gate users.

await sg.createNotificationGroup({notification_group, contract_address});

Get Notification Group By Name

notification_grouprequired
string

The name of the notification group

await sg.getNotificationGroupByName({notification_group});

Get Notification Groups

await sg.getNotificationGroups();

Profiles Management

This allows you to upload profiles manuall to notification groups and retrieve the respective profiles.

Upload/Update Profile

user_addressrequired
string

The address of the user

valuerequired
object

An object containing information regarind the user. For uploading notification data regarding a user, set value to {email, phone}

notification_grouprequired
string

The name of the notification group

await sg.updateProfile({user_address, value, notification_group});

Get Profiles

limitrequired
int

The number of profiles you want to retrieve

offsetrequired
int

The offset of where to begin retrieving users

notification_grouprequired
string

The name of the notification group

await sg.getProfiles({limit, offset, notification_group})

Get Profile

user_addressrequired
string

The address of the user

notification_grouprequired
string

The name of the notification group

await sg.getProfile({user_address, notification_group});