---
title: "GitHub: Introduction"
sidebarTitle: "Introduction"
---
## Installation
```bash npm
npm install @trigger.dev/github@latest
```
```bash pnpm
pnpm install @trigger.dev/github@latest
```
```bash yarn
yarn add @trigger.dev/github@latest
```
## Authentication
GitHub supports Personal Access Tokens and OAuth.
```ts
import { Github } from "@trigger.dev/github";
//create GitHub client using a token
const github = new Github({
id: "github",
token: process.env.GITHUB_TOKEN!,
});
//create GitHub client using OAuth
const github2 = new Github({
id: "github2",
});
```
## Triggers and Tasks
Trigger Jobs when events happen in GitHub, such as a new commit or a new issue.
Perform tasks such as creating a new issue or a new comment.
## Using the underlying client
You can use the underlying client to do anything Octokit supports. In this example we create a project card when a new issue is opened..
View [the official GitHub docs](https://docs.github.com/en/rest) for everything that is
supported{" "}
```ts
import { Github, events } from "@trigger.dev/github";
const github = new Github({
id: "github",
token: process.env.GITHUB_TOKEN!,
});
client.defineJob({
id: "alert-on-new-github-issues",
name: "Alert on new GitHub issues",
version: "0.1.1",
trigger: github.triggers.repo({
event: events.onIssueOpened,
owner: "triggerdotdev",
repo: "trigger.dev",
}),
integrations: {
github,
},
run: async (payload, io, ctx) => {
//io.github.runTask allows you to use the underlying SDK client
const { data } = await io.github.runTask(
"create-card",
async (client) => {
return client.rest.projects.createCard({
column_id: 123,
note: "test",
});
},
{ name: "Create card" }
);
//log the url of the created card
await io.logger.info(data.url);
},
});
```