# Get Feed Details

## User Intent

"I want to retrieve full configuration details for a specific feed"

## Operation

* **SDK Method**: `graphlit.getFeed()`
* **GraphQL**: `getFeed` query
* **Entity Type**: Feed
* **Common Use Cases**: View feed configuration, check OAuth tokens, inspect sync settings

## TypeScript (Canonical)

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

const graphlit = new Graphlit();

const feedId = 'feed-id-here';

// Get full feed details
const feed = await graphlit.getFeed(feedId);

console.log(`\nFeed: ${feed.feed.name}`);
console.log(`Type: ${feed.feed.type}`);
console.log(`State: ${feed.feed.state}`);
console.log(`Created: ${feed.feed.creationDate}`);

// Check type-specific configuration
switch (feed.feed.type) {
  case FeedTypes.Slack: {
    if (!feed.feed.slack) break;
    console.log(`\nSlack Configuration:`);
    console.log(`  Channel: ${feed.feed.slack.channel}`);
    console.log(`  Listing: ${feed.feed.slack.type}`);
    console.log(`  Read Limit: ${feed.feed.slack.readLimit}`);
    console.log(`  Include Attachments: ${feed.feed.slack.includeAttachments}`);
    break;
  }
  case FeedTypes.Web: {
    if (!feed.feed.web) break;
    console.log(`\nWeb Configuration:`);
    console.log(`  Start URI: ${feed.feed.web.uri}`);
    console.log(`  Read Limit: ${feed.feed.web.readLimit}`);
    console.log(`  Include Files: ${feed.feed.web.includeFiles}`);
    console.log(`  Allowed Domains: ${feed.feed.web.allowedDomains?.join(', ')}`);
    break;
  }
  case FeedTypes.Rss: {
    if (!feed.feed.rss) break;
    console.log(`\nRSS Configuration:`);
    console.log(`  URI: ${feed.feed.rss.uri}`);
    console.log(`  Read Limit: ${feed.feed.rss.readLimit}`);
    break;
  }
  case FeedTypes.MicrosoftTeams: {
    if (!feed.feed.microsoftTeams) break;
    console.log(`\nMicrosoft Teams Configuration:`);
    console.log(`  Team ID: ${feed.feed.microsoftTeams.teamId}`);
    console.log(`  Channel ID: ${feed.feed.microsoftTeams.channelId}`);
    console.log(`  Listing: ${feed.feed.microsoftTeams.type}`);
    console.log(`  Read Limit: ${feed.feed.microsoftTeams.readLimit}`);
    console.log(`  Include Attachments: ${feed.feed.microsoftTeams.includeAttachments}`);
    break;
  }
  case FeedTypes.Site: {
    if (!feed.feed.site) break;

    if (feed.feed.site.type === FeedServiceTypes.GoogleDrive) {
      console.log(`\nGoogle Drive Configuration:`);
      console.log(`  Folder ID: ${feed.feed.site.googleDrive?.folderId ?? 'Drive root'}`);
      console.log(`  Files: ${feed.feed.site.googleDrive?.files?.join(', ') ?? 'None'}`);
      console.log(`  Read Limit: ${feed.feed.site.readLimit}`);
    }
    break;
  }
  default: {
    console.log('\nNo specialized configuration for this feed type.');
  }
}
```

## Python

```python
from graphlit import Graphlit

graphlit = Graphlit()

feed_id = "feed-id-here"

feed = await graphlit.client.get_feed(id=feed_id)

print(f"Feed: {feed.feed.name}")
print(f"Type: {feed.feed.type}")
print(f"State: {feed.feed.state}")

if feed.feed.type == "SLACK" and feed.feed.slack:
    print(f"Channel: {feed.feed.slack.channel}")
    print(f"Listing: {feed.feed.slack.type}")
    print(f"ReadLimit: {feed.feed.slack.read_limit}")
    print(f"IncludeAttachments: {feed.feed.slack.include_attachments}")
```

## .NET

```csharp
using GraphlitClient;
using System.Net.Http;
using StrawberryShake;

using var httpClient = new HttpClient();
var graphlit = new Graphlit(httpClient);

var feedId = "feed-id-here";

var response = await graphlit.Client.GetFeed.ExecuteAsync(feedId);
response.EnsureNoErrors();

var feed = response.Data?.Feed;

Console.WriteLine($"Feed: {feed?.Name}");
Console.WriteLine($"Type: {feed?.Type}");
Console.WriteLine($"State: {feed?.State}");

if (feed?.Type == FeedTypes.Slack && feed.Slack != null)
{
    Console.WriteLine($"Channel: {feed.Slack.Channel}");
    Console.WriteLine($"Listing: {feed.Slack.Type}");
    Console.WriteLine($"ReadLimit: {feed.Slack.ReadLimit}");
    Console.WriteLine($"IncludeAttachments: {feed.Slack.IncludeAttachments}");
}
```

## Parameters

* **`id`** (string): Feed ID

## Response

```typescript
{
  feed: {
    id: string;
    name: string;
    type: FeedTypes;
    state: EntityState;
    creationDate: Date;
    slack?: SlackFeedProperties;
    google?: GoogleFeedProperties;
    rss?: RSSFeedProperties;
    web?: WebFeedProperties;
  }
}
```

## Developer Hints

### Inspect Configuration

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

const feed = await graphlit.getFeed(feedId);

// Check what type of feed
switch (feed.feed.type) {
  case FeedTypes.Slack:
    console.log('Slack feed');
    console.log('Channel:', feed.feed.slack?.channel);
    break;
  case FeedTypes.Web:
    console.log('Web crawl feed');
    console.log('Starting URL:', feed.feed.web?.uri);
    break;
  case FeedTypes.Rss:
    console.log('RSS feed');
    console.log('Feed URL:', feed.feed.rss?.uri);
    break;
  case FeedTypes.Site:
    if (feed.feed.site?.type === FeedServiceTypes.GoogleDrive) {
      console.log('Google Drive feed');
      console.log('Folder ID:', feed.feed.site.googleDrive?.folderId);
      console.log('Files:', feed.feed.site.googleDrive?.files);
    }
    break;
}
```

### Check OAuth Token Status

```typescript
const feed = await graphlit.getFeed(feedId);

// OAuth tokens are not returned for security
// If feed is syncing, token is valid
// If feed has errors, token may be expired

if (feed.feed.state === EntityState.Enabled) {
  console.log(' Feed is active');
} else {
  console.log(' Feed is disabled');
}
```

## Variations

### 1. Basic Feed Retrieval

```typescript
const feed = await graphlit.getFeed(feedId);
console.log(feed.feed.name);
```

### 2. Check Configuration

```typescript
const feed = await graphlit.getFeed(feedId);

console.log('Configuration:');
console.log(`  Type: ${feed.feed.type}`);
console.log(`  State: ${feed.feed.state}`);
```

### 3. Verify Sync Settings

```typescript
const feed = await graphlit.getFeed(feedId);

if (feed.feed.web) {
  console.log('Web crawl settings:');
  console.log(`  Max pages: ${feed.feed.web.readLimit}`);
  console.log(`  Include files: ${feed.feed.web.includeFiles}`);
}
```

## Production Example

**Feed health check**:

```typescript
async function checkFeedHealth(feedId: string) {
  const feed = await graphlit.getFeed(feedId);
  
  console.log(`=== FEED HEALTH: ${feed.feed.name} ===`);
  console.log(`Type: ${feed.feed.type}`);
  console.log(`State: ${feed.feed.state}`);
  console.log(`Created: ${new Date(feed.feed.creationDate).toLocaleDateString()}`);
  
  // Check if syncing
  const isDone = await graphlit.isFeedDone(feedId);
  console.log(`Sync Status: ${isDone.isFeedDone.result ? 'Complete' : 'In Progress'}`);
  
  // Count synced content
  const contents = await graphlit.queryContents({
    feeds: [{ id: feedId }]
  });
  console.log(`Content Items: ${contents.contents.results.length}`);
  
  // Health indicator
  const isHealthy = 
    feed.feed.state === EntityState.Enabled && 
    contents.contents.results.length > 0;
  
  console.log(`Health: ${isHealthy ? ' Healthy' : ' Issues Detected'}`);
}

await checkFeedHealth(feedId);
```


---

# 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/feed-get-details.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.
