1.0.8 • Published 10 months ago

@wearemanic/express-twilio-verify v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@wearemanic/express-twilio-verify

Plug-and-play Twilio Verify implementation for Express.

Installation

npm install --save @wearemanic/express-twilio-verify

Usage

import express from 'express';
import OTP from '@wearemanic/express-twilio-verify'

const app = express()

OTP(app, {
  url: `/api/twilio/:phone`,
  verifySid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  accountSid: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  authToken: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
  onLogin ({ phone }) {
    // find or create user
  },
  onError (e) {
    // cry, a lot
  },
})

app.listen(3000)

Note – url and onError are optional; their default values are shown. The return values of onLogin and onError will be passed to the client making the authentication requests.

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago