Skip to content

emmekappa/github-datastudio-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Community Connector for Data Studio

This is not an official Google product

This Data Studio Community Connector lets you query data about repositories in GitHub.

This code is based on googledatastudio/community-connectors

Data Studio Report using the GitHub Community Connector

Set up the Community Connector for personal use

To use this Community Connector in Data Studio there is a one-time setup to deploy your own personal instance of the connector using Apps Script. The GitHub connector also requires additional setup in GitHub to configure OAuth.

1. Deploy the connector

Follow the deployment guide to deploy the Community Connector.

Make a note of the Script ID for the connector, you'll need it for the next step.

  • To find your YOUR_SCRIPT_ID, Visit Apps Script, then click on File -> Project Properties, and you'll see the id under the Info tab.

2. GitHub OAuth App

The GitHub connector requires an OAuth 2.0 client. Follow the steps below to complete the connector setup.

  1. Go to GitHub developer settings.
  2. Click on New OAuth app.
  3. Complete the form...
Text Field Response
Application Name GitHub Community Connector
Homepage URL https://github.com/googledatastudio/community-connectors/tree/master/github
Application Description This application...
Authorization callback URL https://script.google.com/macros/d/{YOUR_SCRIPT_ID}/usercallback

Note: While you can choose your own values for "Application Name", "Homepage URL", and "Application Description", you must follow the pattern for the "Authorization callback URL" in the table above. Replace YOUR_SCRIPT_ID with the value you noted in step #1.

  1. Click Register application.
  2. Visit Apps Script and open your GitHub connector Apps Script project. Click on File -> Project Properties -> Script Properties.
  3. Add the following key-value pairs as script properties:
Key Value
OAUTH_CLIENT_ID {YOUR CLIENT ID}
OAUTH_CLIENT_SECRET {YOUR CLIENT SECRET}

Using the connector in Data Studio

Once you've set up and deployed the connector, follow the Use a Community Connector guide to use the connector in Data Studio.

Note: After using the connector in Data Studio, as long as you do not revoke access, it will remain listed in the connector list for easy access when creating a new data source.

Troubleshooting

This app isn't verified

When authorizing the community connector, if you are presented with an "unverified" warning screen see This app isn't verified for details on how to proceed.

Developer examples covered in the connector

  • OAUTH2 Authentication
    Example of how to authenticate with 3rd party OAUTH2, in this case, GitHub's OAuth 2.0 service.
  • Using Project Properties
    Example of how to use Project Properties (Specifically Script Properties) to save data needed for script execution. Script Properties are useful in situations where values are needed for script execution, but shouldn't be put into source files. In this case, we put an OAUTH2 "client id" and "client secret" into the Script Properties.