1.0.8 • Published 1 year ago
@wearemanic/express-twilio-verify v1.0.8
@wearemanic/express-twilio-verify
Plug-and-play Twilio Verify implementation for Express.
Installation
npm install --save @wearemanic/express-twilio-verifyUsage
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 –
urlandonErrorare optional; their default values are shown. The return values ofonLoginandonErrorwill be passed to the client making the authentication requests.