# Create GitHub Issues Feed

## User Intent

"How do I sync GitHub issues from a repository? Show me GitHub Issues feed configuration."

## Operation

**SDK Method**: `createFeed()` with FeedTypes.Issue\
**Auth**: GitHub personal access token or OAuth

***

## Code Example (TypeScript)

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

const graphlit = new Graphlit();

// Use the GitHub credential stored in the Developer Portal
const authorizationId = process.env.GRAPHLIT_GITHUB_ISSUES_AUTH_ID!;

const repositoriesInput: GitHubRepositoriesInput = {
  authenticationType: GitHubIssueAuthenticationTypes.OAuth,
  authorizationId,
};

// Enumerate repositories this credential can access
const repositoriesResponse = await graphlit.queryGitHubRepositories(repositoriesInput);
const repositories = repositoriesResponse.githubRepositories?.results ?? [];

if (repositories.length === 0) {
  throw new Error('No GitHub repositories available for the authorized account');
}

const { repositoryOwner, repositoryName } = repositories[0]!;
console.log(`Using GitHub repository: ${repositoryOwner}/${repositoryName}`);

const feed = await graphlit.createFeed({
  name: 'GraphQL Issues',
  type: FeedTypes.Issue,
  issue: {
    type: FeedServiceTypes.GitHubIssues,
    github: {
      authorizationId,
      authenticationType: GitHubIssueAuthenticationTypes.OAuth,
      repositoryOwner: repositoryOwner!,
      repositoryName: repositoryName!,
      readLimit: 100,
      includeAttachments: true,
    },
  },
  // Optional: add workflow for content processing
  // workflow: { id: workflow.createWorkflow.id }
});

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

***

## Configuration

**repositoryOwner**: GitHub username or organization\
**repositoryName**: Repository name\
**authorizationId**: Stored GitHub credential identifier (OAuth recommended)\
**authenticationType**: `GitHubIssueAuthenticationTypes.OAuth` or `GitHubIssueAuthenticationTypes.PersonalAccessToken`\
**readLimit**: Number of issues to sync\
**includeAttachments**: Download issue attachments

***

## GitHub Token Setup

1. Developer Portal → Connectors → GitHub Issues
2. Complete OAuth flow with required scopes (`repo`, `write:discussion`, `read:user` as needed)
3. Store the resulting credential; note the `authorizationId`
4. Use `queryGitHubRepositories` to confirm repository access before creating feeds

***

## What Gets Synced

* Issue titles and descriptions
* Issue numbers and states (open/closed)
* Labels and milestones
* Assignees and authors
* Comments and reactions
* Timestamps (created, updated, closed)

***

## Use Cases

**Product Feedback**:

```typescript
repositoryOwner: 'facebook',
repositoryName: 'react'
```

**Bug Tracking**:

```typescript
repositoryOwner: 'your-org',
repositoryName: 'your-product'
```

**Support Tickets**:

```typescript
repositoryOwner: 'company',
repositoryName: 'customer-support'
```

***

## OAuth vs Personal Access Token

**Use OAuth when:**

* Building multi-user applications
* Need user-specific permissions
* Want connector-based auth

**Use Personal Access Token when:**

* Single-user automation
* Service account access
* Simpler setup

***

## Related

* [GitHub Commits Feed](/api-guides/use-cases/feeds/project-management/feed-create-github-commits.md) - Sync repository commits
* [GitHub Pull Requests Feed](/api-guides/use-cases/feeds/project-management/feed-create-github-pull-requests.md) - Sync pull requests
* [GitHub Repository Feed](/api-guides/use-cases/feeds/cloud-storage/feed-create-github.md) - Sync repo files
* [Linear Feed](/api-guides/use-cases/feeds/project-management/feed-create-linear.md) - Linear issue tracking
* [Jira Feed](/api-guides/use-cases/feeds/project-management/feed-create-jira.md) - Jira issue tracking


---

# 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/project-management/feed-create-github-issues.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.
