<commit_before># Digits with React

[Digits](https://get.digits.com/) is a free phone-number-based log in solution. This repository showcases how you can use Digits in a [React application](http://facebook.github.io/react/).

## Getting started

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

Open [`src/ReactDigits.js`](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:

```bash
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`](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`](http://webpack.github.io/docs/library-and-externals.html).

## License

MIT<commit_msg>Add another note about why it's not npm-installable<commit_after># Digits with React

[Digits](https://get.digits.com/) is a free phone-number-based log in solution. This repository showcases how you can use Digits in a [React application](http://facebook.github.io/react/).

## Getting started

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

Open [`src/ReactDigits.js`](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:

```bash
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`](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`](http://webpack.github.io/docs/library-and-externals.html). As a side effect, this is stopping us from creating this solution as a reusable npm-installable component.

## License

MIT
{'fraction_non_alphanumeric': 0.09327387588257154, 'fraction_numerical': 0.005945745076179859, 'mean_word_length': 4.56198347107438, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '842565', 'n_tokens_mistral': 795, 'n_tokens_neox': 764, 'n_words': 341}