Nevertheless! Party Metaphorically

    auth0-extension-hapi-tools

    1.3.1 • Public • Published

    Auth0 Extension Tools for Hapi

    A set of tools and utilities to simplify the development of Auth0 Extensions with Hapi.

    Usage

    const hapiTools = require('auth0-extension-hapi-tools');

    Middlewares

    A middleware to inject the Management API Client for Node.js on the current request:

    const middlewares = require('auth0-extension-express-tools').middlewares;
     
    module.exports.register = (server, options, next) => {
      server.decorate('server', 'handlers', {
        managementClient: middlewares.managementApiClient({
          domain: config('AUTH0_DOMAIN'),
          clientId: config('AUTH0_CLIENT_ID'),
          clientSecret: config('AUTH0_CLIENT_SECRET'),
          logger: console.log
        })
      });
     
      next();
    };

    Url Helpers

    const urlHelpers = require('auth0-extension-express-tools').urlHelpers;
     
    // Eg: /api/run/mytenant/abc/
    const basePath = urlHelpers.getBasePath(req);
     
    // Eg: http://sandbox.it.auth0.com/api/run/mytenant/abc
    const baseUrl = urlHelpers.getBaseUrl(req);
     
    // Eg: http://tenant.us.webtask.io/abc
    const webtaskUrl = urlHelpers.getWebtaskUrl(req);

    Install

    npm i auth0-extension-hapi-tools

    DownloadsWeekly Downloads

    29

    Version

    1.3.1

    License

    MIT

    Unpacked Size

    173 kB

    Total Files

    23

    Last publish

    Collaborators

    • charlesrea
    • julien.wollscheid
    • auth0-oss
    • texeira
    • codepete
    • ziluvatar
    • iaco
    • cocojoe
    • fyockm
    • auth0npm
    • auth0alec
    • auth0brokkr
    • hzalaz
    • glena
    • aaguiarz
    • machuga
    • lbalmaceda
    • jstrutz
    • cristiandouce
    • heyitsry
    • sambego
    • stevehobbsdev
    • bmaxwella0
    • davidmoses
    • sandrinodimattia
    • lzychowski
    • joshcanhelp
    • rob.coles
    • faroceann
    • rosnovsky
    • davidpatrick0
    • widcket
    • adamjmcgrath
    • ldoorz
    • th3maio
    • jim.andersoon
    • fadymak
    • navrupt
    • frederikprijck
    • sergii.biienko
    • tomauth0
    • jakewlacey
    • jpadilla
    • gaj.gulati
    • jessele
    • shushen
    • rhamzeh_auth0
    • greglopez