Integration Google API into Nette Framework for better work with service accounts
The best way to install Kappa\Google is using Composer
$ composer require kappa/doctrine:@dev
google:
appName: "Your app name"
scopes:
- https://www.googleapis.com/auth/calendar
clientId: "" # Your client ID
email: "" # Your client email
key: "" # path to key.p12 file
class BasePresenter extends Presenter
{
/**
* @var \Kappa\Google\Accounts\ServiceAccount
* @inject
*/
public $serviceAccount
public function actionDefault()
{
dump($this->serviceAccount->getClient()) // Returns logged client
die();
}
// ...
}