How to use the @octokit/request.defaults function in @octokit/request

To help you get started, we’ve selected a few @octokit/request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github octokit / app.js / index.js View on Github external
function App ({ id, privateKey, baseUrl, cache }) {
  const state = {
    id,
    privateKey,
    request: baseUrl ? request.defaults({ baseUrl }) : request,
    cache: cache || getCache()
  }
  const api = {
    getSignedJsonWebToken: getSignedJsonWebToken.bind(null, state),
    getInstallationAccessToken: getInstallationAccessToken.bind(null, state)
  }

  return api
}

@octokit/request

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

MIT
Latest version published 5 months ago

Package Health Score

90 / 100
Full package analysis