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_key
string
required

Your developer API-KEY

notification_group
string
required

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

user_address
string
required

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_group
string
required

The group to which you want to send the notification.

text
string
required

The content of the sms that will be sent out.

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

Send Email

notification_group
string
required

The group to which you want to send the notification.

subject
string
required

The subject of the email that will be sent out.

body
string
required

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_address
string
required

The user’s wallet address or other random identifier

notification_group
string
required

The group to which you want to send the notification.

text
string
required

The content of the sms that will be sent out.

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

Send Email

user_address
string
required

The user’s wallet address or other random identifier

notification_group
string
required

The group to which you want to send the notification.

subject
string
required

The subject of the email that will be sent out.

body
string
required

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_group
string
required

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_group
string
required

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_address
string
required

The address of the user

value
object
required

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

notification_group
string
required

The name of the notification group

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

Get Profiles

limit
int
required

The number of profiles you want to retrieve

offset
int
required

The offset of where to begin retrieving users

notification_group
string
required

The name of the notification group

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

Get Profile

user_address
string
required

The address of the user

notification_group
string
required

The name of the notification group

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