# Processors

## Activity Processors

Activity processors enable you to do additional processing on activities after they are posted.

### Activity Processors

The activity processors allow you to add data to an activity when it's added. The most common use case for this is topic analysis using AI.

<codetabs>

<codetabs-item value="swift" label="Swift">

```swift
// Note: This is typically configured server-side
let imageProcessor = ["type": "image_topic"]
let textProcessor = ["type": "text_topic"]

// Run image and text activity processors on any new activity
// Adds the topics found to the activity.interest_tags
let feedGroupConfig: [String: Any] = [
    "id": "foryou",
    "activity_processors": [imageProcessor, textProcessor]
]
```

</codetabs-item>

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

```js
const response = await serverClient.feeds.createFeedGroup({
  feed_group_id: "myid",
  default_view_id: "<view id>",
  activity_processors: [{ type: "image_topic" }, { type: "text_topic" }],
});
```

</codetabs-item>

</codetabs>

This interest tags data can now be used in ranking etc.

### Topic Analyzer

The topic analyzer uses AI to set the topics based on the content of the text and images.

You can enable it like this:

<codetabs>

<codetabs-item value="swift" label="Swift">

```swift
// Note: This is typically configured server-side
let feedGroupConfig: [String: Any] = [
    "id": "myid",
    "activity_processors": [["type": "topic"]]
]
```

</codetabs-item>

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

```js
const response = await serverClient.feeds.createFeedGroup({
  feed_group_id: "myid",
  default_view_id: "<view id>",
  activity_processors: [{ type: "topic" }],
});
```

</codetabs-item>

</codetabs>

Whenever a new activity is posted, it will automatically be enriched with topics:

<codetabs>

<codetabs-item value="swift" label="Swift">

```swift
let activity = try await feed.addActivity(
    request: .init(
        text: "check out my 10 fitness tips for reducing lower back pain",
        type: "post"
    )
)
// The activity will now have topics automatically added
print(activity.interestTags) // ["fitness", "health", "tips"]
```

</codetabs-item>

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

```js
const response = await client.feeds.addActivity({
  fids: ["user:1"],
  type: "post",
  text: "check out my 10 fitness tips for reducing lower back pain",
  user_id: "<user id>",
});

console.log(response.activity.interest_tags); // ["fitness", "health", "tips"]
```

</codetabs-item>

</codetabs>

---

This page was last updated at 2025-08-15T14:14:10.430Z.

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