Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@octokit/app

Package Overview
Dependencies
Maintainers
4
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/app

GitHub Apps toolset for Node.js

  • 13.1.8
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
666K
increased by2.36%
Maintainers
4
Weekly downloads
 
Created

What is @octokit/app?

@octokit/app is a Node.js library for GitHub Apps to authenticate as an app or as an installation. It provides methods to create and verify JSON Web Tokens (JWT) for app authentication and to create installation access tokens.

What are @octokit/app's main functionalities?

Creating a JSON Web Token (JWT)

This feature allows you to create a JWT for your GitHub App. The JWT is used to authenticate as the app itself.

const { App } = require('@octokit/app');
const app = new App({
  id: process.env.APP_ID,
  privateKey: process.env.PRIVATE_KEY
});
const jwt = app.getSignedJsonWebToken();
console.log(jwt);

Creating an installation access token

This feature allows you to create an installation access token, which is used to authenticate as an installation of the app.

const { App } = require('@octokit/app');
const app = new App({
  id: process.env.APP_ID,
  privateKey: process.env.PRIVATE_KEY
});
const installationAccessToken = await app.getInstallationAccessToken({ installationId: 123 });
console.log(installationAccessToken);

Verifying a webhook event

This feature allows you to verify the signature of a webhook event to ensure it came from GitHub.

const { App } = require('@octokit/app');
const app = new App({
  id: process.env.APP_ID,
  privateKey: process.env.PRIVATE_KEY,
  webhooks: {
    secret: process.env.WEBHOOK_SECRET
  }
});
const isValid = app.webhooks.verify(eventPayload, signature);
console.log(isValid);

Other packages similar to @octokit/app

FAQs

Package last updated on 16 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc