From 6ab53b829da8c721244dce83644c28b78671fcf0 Mon Sep 17 00:00:00 2001 From: Brett Langdon Date: Thu, 28 Mar 2013 23:44:22 -0300 Subject: [PATCH] add configuration examples to readme --- README.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d1b5c03..75540f8 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,32 @@ cd ./node-dogapi npm install ``` +## Configuration + +You will need your Datadog api key as well as an application key to use `dogapi`. + +Keys can be found at: https://app.datadoghq.com/account/settings#api + +The keys can be provided either as constructor parameters when creating an instance of `dogapi` +as `api_key` and `app_key` or as the environment variables `DD_API_KEY` and `DD_APP_KEY`. + +**Constructor parameters:** +```javascript +var dogapi = require('dogapi'); + +var options = { + api_key: 'YOUR_KEY_HERE', + app_key: 'YOUR_KEY_HERE', +}; + +var app = new dogapi(options); +``` + +**Environment Variables:** +```bash +DD_API_KEY=YOUR_KEY_HERE DD_APP_KEY=YOUR_KEY_HERE node app.js +``` + ## API `dogapi` implements all available functions in the official datadog api, http://docs.datadoghq.com/api/. @@ -119,4 +145,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.