evervault-express

1.0.0 • Public • Published

evervault-express

NPM Version NPM Downloads

Installation

This is a Node.js module available through the npm registry. Installation is done using the npm install command:

$ npm install evervault-express

API

// replace `YOUR APP ID` with the app ID given to you in the evervault dashboard
const evervault = require('evervault-express')('YOUR APP ID')

evervault(appId)

Injects the evervault SDK for the given appId.

Note The middleware appends a <script/> tag for evervault's SDK to the response body.

Warning The middleware does not check the Content-Type header and appends the <script/> tag to all responses. Only apply it to specific routes if you have routes that return non-HTML responses.

Example

A simple example using evervault-express to integrate evervault auth and SDK.

const express   = require('express')
const evervault = require('evervault-express')

const app = express()

app.use(evervault('hello-world'))

app.get('/', (req, res) => {
  res.send('This app will be protected with evervault auth. The evervault SDK will also be included.')
})

License

MIT

/evervault-express/

    Package Sidebar

    Install

    npm i evervault-express

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.98 kB

    Total Files

    4

    Last publish

    Collaborators

    • narruc