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..613b59a 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=''; + ``` + + ## 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",