Skip to content

suzuki-shunsuke/github-app-token.ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

156 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-app-token.ts

JSR Ask DeepWiki License

github-app-token.ts is a JSR package to create and revoke GitHub App installation access tokens.

Example

import { create, hasExpired, revoke } from "@suzuki-shunsuke/github-app-token";

// Create a GitHub App installation access token.
const token = await githubAppToken.create({
  appId: "123456",
  privateKey,
  owner: "suzuki-shunsuke",
  repositories: ["tfcmt"],
  permissions: {
    issues: "write",
  },
});

const octokit = github.getOctokit(token.token);
// Use octokit...

if (!hasExpired(token.expiresAt)) { // Check if the token has expired.
  await revoke(token.token); // Revoke the token.
}

About

Create and revoke GitHub App installation access tokens

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors