1.0.8 • Published 8 months ago

@wearemanic/express-twilio-verify v1.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago