Developer Documentation for the Google Action "Internet Archive" - adaveinthelife/internet-archive-google-action GitHub Wiki

Getting Started

  1. Fork the project to your github account
  2. Clone your forked repo locally using ssh to project folder using git clone
  3. Install nvm (without sudo). Nvm allows you to update or downgrade versions of node. Cloud functions only currently support node version 6.11.5 but some of our testing functions require 9 or higher. You can still run cloud functions with a higher version.
  4. Install npm (if you don't already have it)
  • DO NOT install npm as sudo or it will create permissions issues later.
  • If you do have npm issues, you can usually clear them up using this guide
  1. Double check the package.json file inside your local repo - this should be identical to the one located on the master repository. This has all the dependencies you will need so it has to be correct.
  2. Go to functions folder inside local repo and type npm install. This will update any npm dependencies you may be missing.
  3. Type npm install -g firebase-tools
  4. Log onto firebase’s website and create a project that you will be using.
  5. Type firebase use --add into the terminal.
  6. Find your firebase project and select it.
  7. Install ngrok. I recommend using their site to create a free account because they give you an auth token which allows you to have a longer session.
  8. Once ngrok is installed, start ngrok in a new terminal by typing ngrok 5000
  9. In dialogflow, under the fulfillment tab - use the https address listed in ngrok to create a url https://<id>.ngrok.io/<name of firebase project>/us-central1/assistant
  10. As described in this Github issue, create a file named .runtimeconfig.json in the functions folder. Add the following to that file and save: { "bespoken": { "key": "fake" }, "dashbot": { "key": "fake" }, "performance": { "requests": "true" } }
  11. While in functions folder, type DEBUG=ia:* npm start
  12. If everything runs correctly, you will see the functions emulator with debug messages. Keep the emulator AND ngrok running in separate terminals.
  13. You can start testing by opening up the google assistant emulator in dialogflow and “talk to test app”. If it’s working correctly, you’ll see connections listed in ngrok and further debug messages in the emulator.