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

@octokit/request

Package Overview
Dependencies
Maintainers
3
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@octokit/request

Send parameterized requests to GitHub’s APIs with sensible defaults in browsers and Node

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9M
decreased by-81.24%
Maintainers
3
Weekly downloads
 
Created

What is @octokit/request?

The @octokit/request npm package is a low-level client for making authenticated requests to GitHub's REST API. It simplifies the process of making HTTP requests to GitHub's API endpoints, handling authentication, and parsing responses. It's part of the Octokit family of tools designed to work with GitHub in various programming languages and environments.

What are @octokit/request's main functionalities?

Making authenticated requests

This feature allows you to make authenticated requests to GitHub's REST API. You can retrieve or manipulate data related to repositories, issues, pull requests, and more. The code sample demonstrates how to fetch issues from a specific repository using a personal access token for authentication.

{
  "const { request } = require('@octokit/request');
  request('GET /repos/{owner}/{repo}/issues', {
    owner: 'octocat',
    repo: 'hello-world',
    headers: {
      authorization: 'token <YOUR_PERSONAL_ACCESS_TOKEN>'
    }
  });"
}

Custom requests

Beyond fetching data, @octokit/request can also be used to create or update resources on GitHub, such as issues, pull requests, and more. The code sample shows how to create a new issue in a repository, demonstrating the package's capability for making various types of authenticated requests.

{
  "const { request } = require('@octokit/request');
  request('POST /repos/{owner}/{repo}/issues', {
    owner: 'octocat',
    repo: 'hello-world',
    title: 'New issue title',
    body: 'Description of the new issue',
    headers: {
      authorization: 'token <YOUR_PERSONAL_ACCESS_TOKEN>'
    }
  });"
}

Other packages similar to @octokit/request

Keywords

FAQs

Package last updated on 12 Nov 2018

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