# Create Reddit Feed

## User Intent

"How do I sync Reddit posts and comments? Show me Reddit feed configuration."

## Operation

**SDK Method**: `createFeed()` with FeedTypes.Reddit\
**Auth**: Reddit API credentials

***

## Code Example (TypeScript)

```typescript
import { Graphlit } from 'graphlit-client';
import { FeedTypes } from 'graphlit-client/dist/generated/graphql-types';

const graphlit = new Graphlit();

const feed = await graphlit.createFeed({
  name: 'r/MachineLearning',
  type: FeedTypes.Reddit,
  reddit: {
    subredditName: 'MachineLearning',
    readLimit: 100,
  },
  // Optional: add workflow for content processing
  // workflow: { id: workflow.createWorkflow.id }
});

console.log(`Created Reddit feed: ${feed.createFeed.id}`);
```

***

## Configuration

**subreddit**: Subreddit name (without r/)\
**readLimit**: Number of posts\
**includeComments**: Sync post comments\
**sortBy**: hot, new, top, rising

***

## Reddit API Setup

1. Reddit → Preferences → Apps
2. Create app (script type)
3. Get client ID and secret
4. Generate access token

***

## What Gets Synced

* Post titles and content
* Author information
* Upvotes/downvotes
* Comments (if enabled)
* Post metadata (flair, awards)

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.graphlit.dev/api-guides/use-cases/feeds/social-media/feed-create-reddit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
