-
Install Module
Run the following command. For example, the Magic Mirror directory is
~/MagicMirror
.cd ~/MagicMirror/modules git clone https://github.com/hermanho/MMM-GooglePhotos.git cd MMM-GooglePhotos npm run install-prod
If you are using Docker
cd ~/MagicMirror/modules git clone https://github.com/hermanho/MMM-GooglePhotos.git docker exec -it -w /opt/magic_mirror/modules/MMM-GooglePhotos magic_mirror npm run install-prod
-
Add MMM-GooglePhotos module config in ~/MagicMirror/config/config.js
Run the following command. For example, the Magic Mirror directory is ~/MagicMirror
.
cd ~/MagicMirror/modules/MMM-GooglePhotos
git pull
npm run install-prod
- Clone this repo in your local pc and execute
npm install
- Go to Google API Console
- From the menu bar, select a project or create a new project.
- To open the Google API Library, from the Navigation menu, select
APIs & Services > Library
. Don't forget to enble the Google API Services. - Search for "Google Photos Library API". Select the correct result and click Enable. (You may need to enable "Google Plus" also.)
- Then from the menu, select
APIs & Services > Credentials
. - On the Credentials page, click
Create Credentials > OAuth client ID
. - Select your Application type as
Desktop app
(IMPORTANT!!!) and submit. (Before or After that, you might be asked for making consent screen. do that.)
Google might change the menu name. So current this would work;
- Then, you can download your credential json file from list. Downloaded file name would be
client_secret_xxxx...xxx.json
. rename it ascredentials.json
and save it to yourMMM-GooglePhotos
directory. - Now, open your termial
cd ~/MagicMirror/modules/MMM-GooglePhotos
node generate_token_v2.js
- At first execution, It will open a browser and will ask you to login google account and to consent your allowance.
- Authorize it and close the browser
- Copy the file
token.json
andcredentials.json
to the folderMMM-GooglePhotos
in the remote device
as of 2021, it appears tokens only last 1 week while in 'testing'. This led to users needing to get a new token.json every ~week to 10 days. To get your app out of testing mode, where the token will last indefinately:
-
go to your google cloud console, select your magic mirror project. Then from the navigation menu(top left) -> APIs & Services -> Oath consent screen. This should get you to a site something like https://console.cloud.google.com/apis/credentials/consent?project=[PROJECT_ID] where [PROJECT_ID] is the project ID. This is where the publishing status. It looks like this:
-
click Publish app and review permissions as necessary.