Skip to content

Instantly share code, notes, and snippets.

@camertron
Created May 23, 2024 23:03
Show Gist options
  • Save camertron/a4850250836876356f8d86579077a5e1 to your computer and use it in GitHub Desktop.
Save camertron/a4850250836876356f8d86579077a5e1 to your computer and use it in GitHub Desktop.
const fs = require('fs')
const { createAppAuth } = require('@octokit/auth-app')
async function main() {
const auth = createAppAuth({
appId: 905201,
privateKey: fs.readFileSync('/path/to/private-key.pem', 'utf8')
});
const appAuth = await auth({
type: 'app',
});
console.log(appAuth.token)
}
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment