how to use third party components? for example google api
- thcom
- Backer | 94
hi, thank you
i learn to use install new nete project with composer
with
cd /var/www
composer create-project nette/web-project my_new_project
i can add google api to my_new_project
cd /var/www/my_new_project
composer require google/apiclient
now the application seem to be working
but another question, where is the right place to store
files like credentials.json and token.json
i choose /app/config/google
is it OK ?
- thcom
- Backer | 94
thank you, please help me little
how to tell to nette, where i have these files
now i use crazzy solution
$client->setAuthConfig('/var/www/nga/app/config/google/credentials.json');
$tokenPath = '/var/www/nga/app/config/google/token.json';
it is working, but i feel it is not good
shoudl i use nette configurator ?
but how, i can find description, which i understand
many thanks
- David Matějka
- Moderator | 6445
it should be enough to register the client as a service and configure it in your config.neon:
services:
googleApiClient:
class: Google_Client
setup:
- setAuthConfig(%appDir%/config/google/credentials.json)