SDK Methods

Detailed information about the available SimpleID SDK methods.

passUserInfo()

This method is intended to send your user's information to SimpleID. This can be as simple as a wallet address or as complex as wallet address, email, and web3 provider.

You should only call this method when a user is signing into your application. Calling it frequently won't hurt the SimpleID data stored, but it could cause performance issues in your application.

const userData = {
email: "myfakeemail@email.com",
address: "0x9485e457c9cb2775f6AfFd0Bd66E53E85755c31C",
provider: "Metamask"
}
Parameters
Response
Parameters

Parameter

Required

email

false

address

true

provider

false

Response
if successful, response is simply:
"success"

signOut()

This method will log a user out of your app and remove the information in local storage that tells SimpleID that the user is already logged in. If you already have a signOut method in your app, you should chain this method on.

notifications()

This method will return the available in-app notifications for your user. If you are using the SimpleID-provided notifications element, you do not need to call this method. However, if you'd like to take the available notifications and push them into your own elements and style them how you'd like, you should use this method.

Here is an example response:

[
{
name: "Notification Example",
active: true,
id: "8dab85f7-2b99-403c-a8c5-d38ada819b25",
content: "<p>This is my notification</p>",
segmentId: "eda97b9d-bcc8-42e5-a773-b923597e814c"
}
]