The add-on lives in Google's Script Editor but, in keeping with best practices, this repo is the source of truth, and the script editor will be overwritten with local changes.
This process needs to be performed once:
npm install
to install all dependencies- Follow the first step here: Node Google Apps Quickstart - "Independent Developer Console Project" is recommended.
- Download the JSON oAuth details
./node_modules/bin/gapps auth <PATH-TO-JSON-OAUTH-FILE>
and follow instructions- Edit the generated
gapps.config.json
file and change the value forpath
to besrc
- Create a new apps script here: https://script.google.com
- Get the script ID from the URL (everything between the
/d/
and/edit
-script.google.com/a/google.com/d/SCRIPT_ID_HERE/edit
) ./node_modules/bin/gapps init <SCRIPT_ID>
- Create a new WordPress.com App:
- Set the redirect URL to be
https://script.google.com/macros/d/SCRIPT_ID/usercallback
- Make a note of the app client ID and client secret
- In the app script, go to
File
andProject Properties
- Select the
Script properties
tab - Add
OauthClientId
and set the value to your app - Add
OauthClientSecret
and set the value to your app
Everything is now setup.
npm run deploy
This will use node-google-apps-script to upload the src
directory to the
add-on's script editor.
In the script editor choose "Publish" → "Test as add-on…" and then select a document to test with.
That will open a new window with your document. You will then see your project in the Add-ons menu.