https://github.com/swinton/insomnia-plugin-github-apps-helper
😴 Insomnia template tags for interacting with GitHub APIs using GitHub Apps
https://github.com/swinton/insomnia-plugin-github-apps-helper
github-apps insomnia-plugin
Last synced: 20 days ago
JSON representation
😴 Insomnia template tags for interacting with GitHub APIs using GitHub Apps
- Host: GitHub
- URL: https://github.com/swinton/insomnia-plugin-github-apps-helper
- Owner: swinton
- License: isc
- Created: 2018-03-29T23:33:57.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2023-01-09T17:04:43.000Z (over 2 years ago)
- Last Synced: 2025-04-30T23:47:59.024Z (20 days ago)
- Topics: github-apps, insomnia-plugin
- Language: JavaScript
- Homepage: https://npm.im/insomnia-plugin-github-apps-helper
- Size: 936 KB
- Stars: 26
- Watchers: 2
- Forks: 3
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `github-apps-helper` 
> :sleeping: **Insomnia** [template tags](https://support.insomnia.rest/article/40-template-tags) for interacting with GitHub APIs using **[GitHub Apps](https://developer.github.com/apps/)**
Provides custom template tags to generate JWTs (JSON Web Tokens) and _installation access tokens_, easing GitHub App authentication when working with GitHub APIs within Insomnia.
## Features
1. JWT (JSON Web Token) generation, for [authenticating as a GitHub App](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app)
1. Installation access token generation, for [authentication as a GitHub App installation](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation)
1. Caching, and automatic regeneration, of installation access tokens
1. Environment-wide configuration, that can be overridden per-request, to ease setup## Installation
Install **insomnia-plugin-github-apps-helper** from the Plugins tab within Insomnia's application preferences dialog:

## Configuration
Set the following [environment variables within Insomnia](https://support.insomnia.rest/article/18-environment-variables):
1. github_app_id: The ID for your GitHub App
- This is available from the settings page of your GitHub App, as `App ID`.
1. github_app_private_key_path: The _path_ on your machine to a private key for your GitHub App, e.g. `/path/to/your-app.YYYY-MM-DD.private-key.pem`
- More information on generating and downloading private keys for your GitHub Apps is [available in the documentation](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#generating-a-private-key)
1. github_app_installation_id: The ID for an installation of your GitHub App
- Found using [the `GET /app/installations`](https://developer.github.com/v3/apps/#find-installations) API endpoint
1. github_api_root: The API Root for your GitHub App## Usage
Two template tags are provided by this plugin:
1. **[`jwt`](#jwt)**: Generates a JSON Web Token, allowing you to authenticate with the GitHub API as your GitHub App
1. **[`installation_access_token`](#installation_access_token)**: Generates an Installation Access Token, allowing you to authenticate with the GitHub API as an installation of your GitHub App### `jwt`
Generates a JSON Web Token, allowing you to [authenticate with the GitHub API as your GitHub App](https://developer.github.com/apps/building-github-apps/authentication-options-for-github-apps/#authenticating-as-a-github-app).
**Usage**
Create a new request, e.g. `GET /app`:
Set [the appropriate URL for your request](https://developer.github.com/v3/apps/#get-a-single-github-app), and configure auth to `Bearer Token`:
Use auto-complete to select the `JSON Web Token` tag:
Hit `Send`. You're good to go :rocket:
### `installation_access_token`
Generates an Installation Access Token, allowing you to [authenticate with the GitHub API as an installation of your GitHub App](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-an-installation).
**Usage**
Create a new request, e.g. `GET /installation/repositories`:
Set [the appropriate URL for your request](https://developer.github.com/v3/apps/installations/#list-repositories), and configure auth to `Bearer Token`:

Use auto-complete to select the `Installation Access Token` tag:
Hit `Send`. You're good to go :rocket:
## Feedback
Please [open an issue](/swinton/insomnia-plugin-github-apps-helper/issues/new).