Interface InstallationTokenProvider

All Known Implementing Classes:
GitHubService

public interface InstallationTokenProvider
A provider of installation tokens for the GitHub app.

Inject as a CDI bean.

NOTE: You generally will not need this bean when processing events, as clients can be automatically injected into event listener methods, simply by adding a parameter of type GitHub or DynamicGraphQLClient to the listener method. This provider is mostly useful for advanced use cases, e.g. when you need to access the GitHub API directly.

  • Method Details

    • getInstallationToken

      InstallationTokenProvider.InstallationToken getInstallationToken(long installationId)
      Gets a valid installation token for a given application installation.

      The token will remain functional a few minutes, so you should discard it after your unit of work and retrieve another one when necessary.

      NOTE: You generally will not need this method when processing events, as clients can be automatically injected into event listener listener methods, simply by adding a parameter of type GitHub to the method. This method can still be useful for advanced use cases, e.g. when you need to access the GitHub API directly.

      Returns:
      The client for the given installation.