How do I import a library from Github when the module is installed I want to add https://github.com/googleads/googleads-php-lib library to my module Drupal 8 I try to add composer. json in the folder module but is not load when I installed module this is solution to upload this library without command "composer update "?

this is my composer.json

{
  "name": "drupal/googleads-php-lib",
  "description": "Integrates the googleads-php-lib library into Drupal",
  "type": "drupal-module",
  "require": {
    "googleads/googleads-php-lib": "25.0.0"
  }
}
composer.json has no bearing when you enable a module in the Drupal admin. Drupal only looks at the info.yml of a module to ensure any listed dependency (module only) exists and has been met. Using drush also won't work. You need Composer for this.

You would need to require your module via composer require drupal/mymodule - at which point any dependencies listed in require would also be pulled in. For that to work, your module would need to be posted on drupal.org, with the Drupal packages repository added to your root composer.json file.

You could also add a repository endpoint pointed at GitHub, Bitbucket or any other VCS service, add a baseline composer.json file to your project and require it that way, too.

You can also do composer require googleads/googleads-php-lib:25.0.0 from your Drupal root to pull in that package, but I would go the module route (so that package is always tied with the module).