auth0/docs-cli

Name: docs-cli

Owner: Auth0

Description: Auth0 Docs API client

Created: 2015-09-28 19:57:58.0

Updated: 2016-07-28 13:41:39.0

Pushed: 2016-07-28 13:41:38.0

Homepage: null

Size: 2183

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Auth0 Docs CLI

This library provides a module to fetch Auth0 documentation both client and server side. Catching and fetching features are considered core details of this library

Installation

To install the dependencies, execute:

npm install

Usage (local)

To build and run the library locally, you can run npm run dev, that will let you include the library from http://localhost:9999/docs-cli.js, there is an small demo to test the library in http://localhost:9999/

Usage (deploy)

To use it, you have to include the script which has been built, it is built with major, minor and fix versions to be able to granularly specify versioning. You can include either the complete or minified version.

For example, for version 1.3.7, the following files will be built:

-cli-1.js
-cli-1.3.js
-cli-1.3.7.js
-cli-1.min.js
-cli-1.3.min.js
-cli-1.3.7.min.js
Examples
Basic set up
r docs = new Auth0Docs();

cs.get(path).then(function(result) {
...
;
Example 1: Setting a custom cache library

(see https://github.com/jpodwys/cache-service)

r myAwsomeCache = ...
r docs = new Auth0Docs({ cache: myAwsomeCache });

cs.get('connections').then(function(result) {
...
;
Example 2: Setting TTL (for the cache)
r docs = new Auth0Docs({ ttl: 60 /* Secs */ });

cs.get('connections/something').then(function(result) {
...
;
Example 3: Setting Base URL
r docs = new Auth0Docs({ baseURL: 'http://myexample.com/meta' });

cs.get('connections/something').then(function(result) {
...
;

This example will do a request to http://myexample.com/meta/connections/something. Remember to set up CORs to be able to make the request.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.