evervault-express
v1.0.0
Published
Express.js middleware that injects the evervault SDK and sets up evervault auth
Downloads
5
Readme
evervault-express
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.')
})