From 1ecb7a2a8c4ed1ba58b4e75a1f612142f6dac10d Mon Sep 17 00:00:00 2001 From: Pasan Missaka Date: Fri, 27 Oct 2017 19:37:45 +0530 Subject: [PATCH 1/2] added the .env_sample and instructions in the readme to configure it --- .env_sample | 1 + .gitignore | 3 +++ README.md | 10 ++++++++++ lib/client.js | 1 + package.json | 4 +++- 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .env_sample diff --git a/.env_sample b/.env_sample new file mode 100644 index 0000000..5181d91 --- /dev/null +++ b/.env_sample @@ -0,0 +1 @@ +SENDGRID_API_KEY=''; \ No newline at end of file diff --git a/.gitignore b/.gitignore index e42f508..53e3aae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# environment variables +.env + # Logs logs *.log diff --git a/README.md b/README.md index aa8ec03..a5bd493 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,16 @@ All updates to this library are documented in our [CHANGELOG](https://github.com - Node.js version 0.10, 0.12 or 4 +You need to have a API key to use the app. To configure the API key in the environment variables follow these steps. + - create .env file in the root directory of the project. + - Copy the contents of .env_sample file in to the .env file + - Once you have obtained the API key, find the environment variable SENDGRID_API_KEY and assign your API key as it's value. + As an example it should look like this + ``` + SENDGRID_API_KEY='Ef34Gyt&dfPFC34G'; + ``` + + ## Install Package ```bash diff --git a/lib/client.js b/lib/client.js index 78d98c3..ad954c1 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,5 +1,6 @@ 'use strict' +require('dotenv').config(); var https = require('https') var http = require('http') var queryString = require('querystring') diff --git a/package.json b/package.json index 5b1eda0..0dbc2b6 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ "engines": { "node": ">= 0.10" }, - "dependencies": {}, + "dependencies": { + "dotenv": "^4.0.0" + }, "devDependencies": { "chai": "^3.5.0", "eslint": "^2.7.0", From 61a647daa6924b9d2c8c9b749048dd189bb0faa7 Mon Sep 17 00:00:00 2001 From: Pasan Missaka Date: Sun, 29 Oct 2017 09:21:23 +0530 Subject: [PATCH 2/2] Changes to the readme according to the request --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5bd493..613b59a 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ You need to have a API key to use the app. To configure the API key in the envir - Once you have obtained the API key, find the environment variable SENDGRID_API_KEY and assign your API key as it's value. As an example it should look like this ``` - SENDGRID_API_KEY='Ef34Gyt&dfPFC34G'; + SENDGRID_API_KEY=''; ```