Skip to content

AnSavvides/react-digits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Digits with React

Digits is a free phone-number-based log in solution. This repository showcases how you can use Digits in a React application.

Getting started

git clone https://github.com/AnSavvides/react-digits.git cd react-digits npm install grunt watch

Open src/ReactDigits.js and enter your consumer key inside the componentWillMount function where we first initialize Digits.

In another terminal window run a simple HTTP server locally:

python -m SimpleHTTPServer 8000

Head over to localhost:8000 and you should be able to see this code in action.

Notes

  • This is a front-end only implementation and it is assumed that you have written code to handle the validation logic in the back-end. See the onLoginSuccess function in src/ReactDigits.js where we make a POST request with JSON to a /user/verify endpoint
  • Digits is not available as an npm package, but rather over CDN; because of that, we had to include the Digits web SDK over CDN & reference it in our webpack configuration in externals.

License

MIT

About

Use Twitter's Digits for Web in your React app

Resources

License

Stars

Watchers

Forks

Packages

No packages published