function instagramOAuth2Client() {
  // Instagram OAuth 2 setup
  // TODO: Configure the `instagram.client_id` and `instagram.client_secret` Google Cloud environment variables.
  const credentials = {
    client: {
      id: functions.config().instagram.client_id,
      secret: functions.config().instagram.client_secret,
    },
    auth: {
      tokenHost: 'https://api.instagram.com',
      tokenPath: '/oauth/access_token',
    },
  };
  return require('simple-oauth2').create(credentials);
}
Creates a configured simple-oauth2 client for Instagram.