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);

Package Sidebar

Install

npm i auth0-extension-hapi-tools

Weekly Downloads

3

Version

1.3.1

License

MIT

Unpacked Size

173 kB

Total Files

23

Last publish

Collaborators

  • jfromaniello
  • edgarchirivella-okta
  • sanjay.manikandhan
  • ncluer
  • vic-dev
  • enriquepina
  • ece-okta
  • pubalokta
  • dougmiller-okta
  • zak.nour
  • stheller
  • jamescgarrett-okta
  • madhuri.rm23
  • willvedd
  • david.renaud.okta
  • jeff.shuman
  • auth0-oss
  • codepete
  • ziluvatar
  • iaco
  • cocojoe
  • auth0npm
  • auth0brokkr
  • hzalaz
  • aaguiarz
  • charlesrea
  • lbalmaceda
  • julien.wollscheid
  • cristiandouce
  • sambego
  • stevehobbsdev
  • sandrinodimattia
  • lzychowski
  • joshcanhelp
  • davidpatrick0
  • widcket
  • adamjmcgrath
  • jim.andersoon
  • frederikprijck
  • sergii.biienko
  • tomauth0
  • jpadilla
  • jessele
  • rhamzeh_auth0