Skip to content

Commit

Permalink
Merge pull request #124 from notificationapi-com/react_sdk_identify
Browse files Browse the repository at this point in the history
added identify, modified provider
  • Loading branch information
A-KGeorge authored Oct 23, 2024
2 parents 437b9ed + af86fc0 commit cb255de
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/reference/react-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ import { NotificationAPIProvider } from '@notificationapi/react';

<App>
<NotificationAPIProvider
userId="abcd-1234" // logged in userId
clientId="abc123" // your clientId found on the dashboard
userId="abcd-1234" // logged in userId
// or use this instead
// user={{
// id: "abcd-1234", // logged in userId
// }}
playSoundOnNewNotification={true} // Allow the user to hear default sound on new notification
>

Expand Down Expand Up @@ -493,6 +497,17 @@ The in-app notification object takes several arguments.
| **replies** | `object: { date: string, message: string }[],` | Coming soon - Contains user comments/replies to the notification if enabled. |
| **title** | `string` | A title for your in-app notification. |
## identify
Stores the end-user information for a given user.
```javascript
notificationapi
.getClient()
.identify({ id: '' }) // or mention the userId passed in the provider
.then((result) => console.log(result));
```
<!-- -->
<!-- -->
<!-- -->
Expand Down

0 comments on commit cb255de

Please sign in to comment.