Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 44 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -828,18 +828,55 @@ This is a user that doesn't have any identifiable information such as a userId o

---

### `Intercom.loginUserWithUserAttributes({email,userId})`
### `Intercom.loginUserWithUserAttributes(userAttributes)`

Login a user with identifiable information.
Login a user with identifiable information. You can pass any user attributes at login time, allowing you to set user data in a single call rather than requiring a separate `updateUser` call.

###### One of `email` or `userId` is required.

```javascript
Intercom.loginUserWithUserAttributes({
email: 'name@intercom.com',
userId: 'userId',
name: 'Name',
phone: '010-1234-5678',
languageOverride: 'languageOverride',
signedUpAt: 1621844451,
unsubscribedFromEmails: true,
companies: [
{
createdAt: 1621844451,
id: 'companyId',
monthlySpend: 100,
name: 'CompanyName',
plan: 'plan',
customAttributes: {
city: 'New York',
},
},
],
customAttributes: {
userCustomAttribute: 123,
hasUserCustomAttribute: true,
},
});
```

### Options

One of below fields is required.
| Type | Type | Required |
| ---------------------- | -------------------------------------- | -------- |
| userId | string | yes* |
| email | string | yes* |
| name | string | no |
| phone | string | no |
| languageOverride | string | no |
| signedUpAt | number (timestamp) | no |
| unsubscribedFromEmails | boolean | no |
| companies | array | no |
| customAttributes | object `{key: boolean,string, number}` | no |

| Type | Type | Required |
| ------ | ------ | -------- |
| email | string | no |
| userId | string | no |
\* One of `email` or `userId` is required.

### Returns

Expand Down
2 changes: 1 addition & 1 deletion examples/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PODS:
- fmt (9.1.0)
- glog (0.3.5)
- Intercom (19.5.4)
- intercom-react-native (9.7.1):
- intercom-react-native (9.8.0):
- DoubleConversion
- glog
- Intercom (~> 19.5.4)
Expand Down
2 changes: 1 addition & 1 deletion examples/with-notifications/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ PODS:
- hermes-engine/Pre-built (= 0.81.1)
- hermes-engine/Pre-built (0.81.1)
- Intercom (19.5.4)
- intercom-react-native (9.7.1):
- intercom-react-native (9.8.0):
- boost
- DoubleConversion
- fast_float
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@intercom/intercom-react-native",
"version": "9.7.1",
"version": "9.8.0",
"description": "React Native wrapper to bridge our iOS and Android SDK",
"source": "./src/index.tsx",
"main": "./lib/commonjs/index.js",
Expand Down
Loading