# Push Preferences

Push preferences for Activity Feeds allow users to control how they receive push notifications for feed events. You can set preferences at the user level to control notifications for reactions, comments, follows, and other feed activities.

## How Feeds Push Preferences Work

### Feeds push preferences operate at the user level

- **User-level preferences**: Global preferences that apply to all feed activities for a user.
- **Event-specific preferences**: Granular control over specific types of feed events (reactions, comments, follows, mentions).

### Feeds push preferences support two levels of notifications

- **all**: Receive all push notifications for feed events **(default)**.
- **none**: Do not receive push notifications for feed events.

Additionally, you can temporarily disable push notifications until a specific time using the `disabled_until` parameter.

### The system evaluates preferences in the following priority order

1. **Global disabled_until**: If set and the current time is before that timestamp, all feed notifications are disabled.
2. **Feeds level**: If set to "none", all feed notifications are disabled.
3. **Event-specific preferences**: For specific event types (reactions, comments, follows), these override the global feeds level.
4. **Default behavior**: If no preferences are set, the default is "all".

## Setting Push Preferences

### User-Level Feeds Preferences

Set global push preferences that apply to all feed activities for a user:

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Set basic feeds push level
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // "all" or "none"
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Set basic feeds push level
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // "all" or "none"
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Set basic feeds push level
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // "all" or "none"
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
val input = PushPreferenceInput(
    feedsLevel = PushPreferenceInput.FeedsLevel.All // or None
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>

### Event-Specific Feeds Preferences

Control notifications for specific types of feed events:

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Set granular event preferences
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // Global feeds level
      feeds_preferences: {
        reaction: "all", // Receive notifications for reactions
        comment: "all", // Receive notifications for activity comments
        comment_reaction: "all", // Receive notifications for comment reactions
        follow: "none", // Don't receive notifications for new followers
        mention: "all", // Receive notifications for mentions
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Set granular event preferences
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // Global feeds level
      feeds_preferences: {
        reaction: "all", // Receive notifications for reactions
        comment: "all", // Receive notifications for activity comments
        comment_reaction: "all", // Receive notifications for comment reactions
        follow: "none", // Don't receive notifications for new followers
        mention: "all", // Receive notifications for mentions
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Set granular event preferences
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // Global feeds level
      feeds_preferences: {
        reaction: "all", // Receive notifications for reactions
        comment: "all", // Receive notifications for activity comments
        comment_reaction: "all", // Receive notifications for comment reactions
        follow: "none", // Don't receive notifications for new followers
        mention: "all", // Receive notifications for mentions
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
val input = PushPreferenceInput(
    feedsLevel = PushPreferenceInput.FeedsLevel.All, // Global feeds level
    feedsPreferences = FeedsPreferences(
        reaction = FeedsPreferences.Reaction.All, // Receive notifications for reactions
        comment = FeedsPreferences.Comment.All, // Receive notifications for activity comments
        commentReaction = FeedsPreferences.CommentReaction.All, // Receive notifications for comment reactions
        follow = FeedsPreferences.Follow.None, // Don't receive notifications for new followers
        mention = FeedsPreferences.Mention.All // Receive notifications for mentions

    )
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>

### Temporarily Disable Feeds Notifications

Disable all feed notifications until a specific time:

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Disable feeds notifications for 2 hours
const twoHoursFromNow = new Date();
twoHoursFromNow.setHours(twoHoursFromNow.getHours() + 2);

await client.updatePushNotificationPreferences({
  preferences: [
    {
      user_id: "user-1",
      feeds_level: "all",
      disabled_until: twoHoursFromNow.toISOString(),
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Disable feeds notifications for 2 hours
const twoHoursFromNow = new Date();
twoHoursFromNow.setHours(twoHoursFromNow.getHours() + 2);

await client.updatePushNotificationPreferences({
  preferences: [
    {
      user_id: "user-1",
      feeds_level: "all",
      disabled_until: twoHoursFromNow.toISOString(),
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Disable feeds notifications for 2 hours
const twoHoursFromNow = new Date();
twoHoursFromNow.setHours(twoHoursFromNow.getHours() + 2);

await client.updatePushNotificationPreferences({
  preferences: [
    {
      user_id: "user-1",
      feeds_level: "all",
      disabled_until: twoHoursFromNow.toISOString(),
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
val twoHoursFromNow = Calendar.getInstance()
    .apply { add(Calendar.HOUR_OF_DAY, 2) }
    .time

val input = PushPreferenceInput(
    feedsLevel = PushPreferenceInput.FeedsLevel.All,
    disabledUntil = twoHoursFromNow
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>

## Feed Event Types

The following feed event types support granular push preferences:

### Built-in Event Types

| Event Type        | Description                                        | Preference Key     |
| ----------------- | -------------------------------------------------- | ------------------ |
| Reactions         | When someone reacts to your activities or comments | `reaction`         |
| Comments          | When someone comments on your activities           | `comment`          |
| Comment Reactions | When someone reacts to your comments               | `comment_reaction` |
| New Followers     | When someone follows you                           | `follow`           |
| Mentions          | When you are mentioned in activities or comments   | `mention`          |

### Custom Activity Types

You can also configure push preferences for any custom activity types using the `custom_activity_types` field:

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
await client.updatePushNotificationPreferences({
  preferences: [
    {
      user_id: "user-1",
      feeds_level: "all",
      feeds_preferences: {
        // Built-in event preferences
        reaction: "all",
        comment: "all",
        comment_reaction: "all",
        follow: "none",
        mention: "all",
        // Custom activity type preferences
        custom_activity_types: {
          milestone: "all", // Allow milestone notifications
          achievement: "all", // Allow achievement notifications
          system_alert: "none", // Block system alert notifications
          promotion: "none", // Block promotional notifications
          custom_celebration: "all", // Allow custom celebration notifications
        },
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
await client.updatePushNotificationPreferences({
  preferences: [
    {
      user_id: "user-1",
      feeds_level: "all",
      feeds_preferences: {
        // Built-in event preferences
        reaction: "all",
        comment: "all",
        comment_reaction: "all",
        follow: "none",
        mention: "all",
        // Custom activity type preferences
        custom_activity_types: {
          milestone: "all", // Allow milestone notifications
          achievement: "all", // Allow achievement notifications
          system_alert: "none", // Block system alert notifications
          promotion: "none", // Block promotional notifications
          custom_celebration: "all", // Allow custom celebration notifications
        },
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
await client.updatePushNotificationPreferences({
  preferences: [
    {
      user_id: "user-1",
      feeds_level: "all",
      feeds_preferences: {
        // Built-in event preferences
        reaction: "all",
        comment: "all",
        comment_reaction: "all",
        follow: "none",
        mention: "all",
        // Custom activity type preferences
        custom_activity_types: {
          milestone: "all", // Allow milestone notifications
          achievement: "all", // Allow achievement notifications
          system_alert: "none", // Block system alert notifications
          promotion: "none", // Block promotional notifications
          custom_celebration: "all", // Allow custom celebration notifications
        },
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
val input = PushPreferenceInput(
    feedsLevel = PushPreferenceInput.FeedsLevel.All,
    // Built-in event preferences
    feedsPreferences = FeedsPreferences(
        reaction = FeedsPreferences.Reaction.All,
        comment = FeedsPreferences.Comment.All,
        commentReaction = FeedsPreferences.CommentReaction.All,
        follow = FeedsPreferences.Follow.All,
        mention = FeedsPreferences.Mention.All,
        // Custom activity type preferences
        customActivityTypes = mapOf(
            "milestone" to "all", // Allow milestone notifications
            "achievement" to "all", // Allow achievement notifications
            "system_alert" to "none", // Block system alert notifications
            "promotion" to "none", // Block promotional notifications
            "custom_celebration" to "all", // Allow custom celebration notifications
        )
    )
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>

**How Custom Activity Types Work:**

- Map any `activity.type` to a preference (`"all"` or `"none"`)
- Custom types not specified in the map default to `"all"`
- This gives you complete control over which custom events trigger push notifications

## Client-Side vs Server-Side Usage

### Client-Side Usage

When using client-side authentication, users can only update their own preferences:

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Client-side: user_id is automatically set to the current user
await client.updatePushNotificationPreferences({
  preferences: [
    {
      // user_id not needed - automatically set to current user
      feeds_level: "all",
      feeds_preferences: {
        reaction: "none",
        comment: "all",
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Client-side: user_id is automatically set to the current user
await client.updatePushNotificationPreferences({
  preferences: [
    {
      // user_id not needed - automatically set to current user
      feeds_level: "all",
      feeds_preferences: {
        reaction: "none",
        comment: "all",
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Client-side: user_id is automatically set to the current user
await client.updatePushNotificationPreferences({
  preferences: [
    {
      // user_id not needed - automatically set to current user
      feeds_level: "all",
      feeds_preferences: {
        reaction: "none",
        comment: "all",
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
// Client-side: user_id is automatically set to the current user
val input = PushPreferenceInput(
    // userId not needed - automatically set to current user
    feedsLevel = PushPreferenceInput.FeedsLevel.All,
    feedsPreferences = FeedsPreferences(
        reaction = FeedsPreferences.Reaction.None,
        comment = FeedsPreferences.Comment.All,
    )
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>

### Server-Side Usage

With server-side authentication, you can update preferences for any user:

<codetabs>

<codetabs-item value="node" label="Node">

```js
// Server-side: can update preferences for any user
await client.updatePushNotificationPreferences({
  preferences: [
    {
      user_id: "user-1",
      feeds_level: "none",
    },
    {
      user_id: "user-2",
      feeds_preferences: {
        reaction: "all",
        comment: "none",
        follow: "all",
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="go" label="Go">

```go
// Update push notification preferences for multiple users
_, err = client.UpdatePushNotificationPreferences(ctx, &getstream.UpdatePushNotificationPreferencesRequest{
  Preferences: []getstream.PushPreferenceInput{
    {
      UserID:     getstream.PtrTo("user-1"),
      FeedsLevel: getstream.PtrTo("none"),
    },
    {
      UserID: getstream.PtrTo("user-2"),
      FeedsEvents: &getstream.FeedsEventPreferencesInput{
        Reactions: getstream.PtrTo("all"),
        Comments:  getstream.PtrTo("none"),
        NewFollowers: getstream.PtrTo("all"),
      },
    },
  },
})

if err != nil {
  log.Fatal("Error updating push notification preferences:", err)
}
```

</codetabs-item>

<codetabs-item value="php" label="php">

```php
// Update push notification preferences for multiple users
$response = $client->updatePushNotificationPreferences(
    new \GetStream\GeneratedModels\UpsertPushPreferencesRequest([
        'preferences' => [
            new \GetStream\GeneratedModels\PushPreferenceInput(
                userID: "user-1",
                feedsLevel: "none"
            ),
            new \GetStream\GeneratedModels\PushPreferenceInput(
                userID: "user-2",
                feedsLevel: "all",
                feedsPreferences: new \GetStream\GeneratedModels\FeedsPreferences(
                    reaction: "all",
                    comment: "none",
                    follow: "all"
                )
            ),
        ]
    ])
);
```

</codetabs-item>

</codetabs>

## Follow Push Preferences

When following users or feeds, you can set push preferences to control notifications for future activities from those feeds.

### Setting Follow Push Preferences

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Follow with push preference for all activities
await timeline.follow("user:alice", {
  push_preference: "all", // Receive notifications for Alice's future activities
});

// Follow with no push notifications for activities
await timeline.follow("user:bob", {
  push_preference: "none", // Don't receive notifications for Bob's activities
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Follow with push preference for all activities
await timeline.follow("user:alice", {
  push_preference: "all", // Receive notifications for Alice's future activities
});

// Follow with no push notifications for activities
await timeline.follow("user:bob", {
  push_preference: "none", // Don't receive notifications for Bob's activities
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Follow with push preference for all activities
await timeline.follow("user:alice", {
  push_preference: "all", // Receive notifications for Alice's future activities
});

// Follow with no push notifications for activities
await timeline.follow("user:bob", {
  push_preference: "none", // Don't receive notifications for Bob's activities
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
// Follow with push preference for all activities
timeline.follow(
    targetFid = FeedId("user:alice"),
    // Receive notifications for Alice's future activities
    pushPreference = FollowRequest.PushPreference.All,
)

// Follow with no push notifications for activities
timeline.follow(
    targetFid = FeedId("user:bob"),
    // Don't receive notifications for Bob's activities
    pushPreference = FollowRequest.PushPreference.None
)
```

</codetabs-item>

</codetabs>

### Follow Push Preference Options

| Value  | Description                                                                          |
| ------ | ------------------------------------------------------------------------------------ |
| `all`  | Receive push notifications for all activities from the followed feed                 |
| `none` | Don't receive push notifications for activities from the followed feed **(default)** |

**Note:** Follow push preferences are different from user-level push preferences:

- **Follow push preferences** control notifications from specific feeds you follow
- **User-level push preferences** control global notification settings for all feeds

## Examples

### Complete Feeds Preferences Setup

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Set comprehensive feeds preferences
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // Enable feeds notifications globally
      feeds_preferences: {
        // Built-in event preferences
        reaction: "all", // Get notified of all activity reactions
        comment: "all", // Get notified of all comments
        comment_reaction: "all", // Get notified of all comment reactions
        follow: "none", // Don't notify for new followers
        mention: "all", // Get notified when mentioned
        // Custom activity type preferences
        custom_activity_types: {
          milestone: "all", // Allow milestone notifications
          achievement: "all", // Allow achievement notifications
          system_maintenance: "none", // Block maintenance notifications
          promotional_offer: "none", // Block promotional notifications
        },
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Set comprehensive feeds preferences
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // Enable feeds notifications globally
      feeds_preferences: {
        // Built-in event preferences
        reaction: "all", // Get notified of all activity reactions
        comment: "all", // Get notified of all comments
        comment_reaction: "all", // Get notified of all comment reactions
        follow: "none", // Don't notify for new followers
        mention: "all", // Get notified when mentioned
        // Custom activity type preferences
        custom_activity_types: {
          milestone: "all", // Allow milestone notifications
          achievement: "all", // Allow achievement notifications
          system_maintenance: "none", // Block maintenance notifications
          promotional_offer: "none", // Block promotional notifications
        },
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Set comprehensive feeds preferences
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all", // Enable feeds notifications globally
      feeds_preferences: {
        // Built-in event preferences
        reaction: "all", // Get notified of all activity reactions
        comment: "all", // Get notified of all comments
        comment_reaction: "all", // Get notified of all comment reactions
        follow: "none", // Don't notify for new followers
        mention: "all", // Get notified when mentioned
        // Custom activity type preferences
        custom_activity_types: {
          milestone: "all", // Allow milestone notifications
          achievement: "all", // Allow achievement notifications
          system_maintenance: "none", // Block maintenance notifications
          promotional_offer: "none", // Block promotional notifications
        },
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
// Set comprehensive feeds preferences
val input = PushPreferenceInput(
    feedsLevel = PushPreferenceInput.FeedsLevel.All, // Enable feeds notifications globally
    feedsPreferences = FeedsPreferences(
        // Built-in event preferences
        reaction = FeedsPreferences.Reaction.All, // Get notified of all activity reactions
        comment = FeedsPreferences.Comment.All, // Get notified of all comments
        commentReaction = FeedsPreferences.CommentReaction.All, // Get notified of all comment reactions
        follow = FeedsPreferences.Follow.None, // Don't notify for new followers
        mention = FeedsPreferences.Mention.All, // Get notified when mentioned
        // Custom activity type preferences
        customActivityTypes = mapOf(
            "milestone" to "all", // Allow milestone notifications
            "achievement" to "all", // Allow achievement notifications
            "system_maintenance" to "none", // Block maintenance notifications
            "promotional_offer" to "none", // Block promotional notifications
        )
    )
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>

### Do Not Disturb Mode for Feeds

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Enable "Do Not Disturb" for feeds until tomorrow
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(9, 0, 0, 0); // 9 AM tomorrow

await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "none",
      disabled_until: tomorrow.toISOString(),
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Enable "Do Not Disturb" for feeds until tomorrow
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(9, 0, 0, 0); // 9 AM tomorrow

await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "none",
      disabled_until: tomorrow.toISOString(),
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Enable "Do Not Disturb" for feeds until tomorrow
const tomorrow = new Date();
tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(9, 0, 0, 0); // 9 AM tomorrow

await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "none",
      disabled_until: tomorrow.toISOString(),
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
// Enable "Do Not Disturb" for feeds until 9 AM tomorrow
val tomorrow = Calendar.getInstance()
    .apply {
        add(Calendar.DAY_OF_MONTH, 1)
        set(Calendar.HOUR_OF_DAY, 9)
        set(Calendar.MINUTE, 0)
        set(Calendar.SECOND, 0)
        set(Calendar.MILLISECOND, 0)
    }
    .time

val input = PushPreferenceInput(
    feedsLevel = PushPreferenceInput.FeedsLevel.None,
    disabledUntil = tomorrow
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>

### Minimal Feeds Notifications

<codetabs>

<codetabs-item value="javascript" label="JavaScript">

```js
// Only get notified for comments and mentions
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all",
      feeds_preferences: {
        reaction: "none", // Skip reaction notifications
        comment: "all", // Keep comment notifications
        follow: "none", // Skip follower notifications
        mention: "all", // Keep mention notifications
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="react" label="React">

```js
// Only get notified for comments and mentions
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all",
      feeds_preferences: {
        reaction: "none", // Skip reaction notifications
        comment: "all", // Keep comment notifications
        follow: "none", // Skip follower notifications
        mention: "all", // Keep mention notifications
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="reactnative" label="React Native">

```js
// Only get notified for comments and mentions
await client.updatePushNotificationPreferences({
  preferences: [
    {
      feeds_level: "all",
      feeds_preferences: {
        reaction: "none", // Skip reaction notifications
        comment: "all", // Keep comment notifications
        follow: "none", // Skip follower notifications
        mention: "all", // Keep mention notifications
      },
    },
  ],
});
```

</codetabs-item>

<codetabs-item value="kotlin" label="Kotlin">

```kotlin
// Only get notified for comments and mentions
val input = PushPreferenceInput(
    feedsLevel = PushPreferenceInput.FeedsLevel.All,
    feedsPreferences = FeedsPreferences(
        reaction = FeedsPreferences.Reaction.None, // Skip reaction notifications
        comment = FeedsPreferences.Comment.All, // Keep comment notifications
        follow = FeedsPreferences.Follow.None, // Skip follower notifications
        mention = FeedsPreferences.Mention.All // Keep mention notifications
    )
)
client.updatePushNotificationPreferences(
    UpsertPushPreferencesRequest(preferences = listOf(input))
)
```

</codetabs-item>

</codetabs>


---

This page was last updated at 2026-03-05T19:01:33.803Z.

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/react/push_preferences/](https://getstream.io/activity-feeds/docs/react/push_preferences/).