|
| 1 | +<h1 align="center">Broprint.js</h1> |
| 2 | +<p align="center">The world's easiest, smallest and powerful visitor identifier for browsers.</p> |
| 3 | + |
| 4 | +<p align="center"> |
| 5 | + <a href="https://github.com/Rajesh-Royal/Broprint.js"><img src="https://img.shields.io/badge/total%20size-2.12%20KB-brightgreen" height="20"/></a> |
| 6 | + <a href="https://www.npmjs.com/package/@rajesh896/broprint.js"> |
| 7 | + <img src="https://img.shields.io/npm/v/@rajesh896/broprint.js" alt="Current NPM version"> |
| 8 | + </a> |
| 9 | + <a href="https://twitter.com/intent/tweet?text=The world's easiest, smallest and powerful visitor identifier for browsers.&url=https://github.com/Rajesh-Royal/Broprint.js&hashtags=javascript,opensource,js,webdev,developers"><img src="http://randojs.com/images/tweetShield.svg" alt="Tweet" height="20"/></a> |
| 10 | +</p><br/><br/> |
| 11 | + |
| 12 | + |
| 13 | +<p align="center"> |
| 14 | +This package generates a unique ID/String for different browsers. Like chrome, Firefox or any other browsers which support `canvas` and `audio` fingerprinting. You can easily do the browser fingerprinting with this library. Its small and minimal.</p> |
| 15 | + |
| 16 | +<p align="center"><a href="https://github.com/Rajesh-Royal/Broprint.js"><img src="https://user-images.githubusercontent.com/24524924/163906729-f34e193a-e202-43ae-ba4b-c460da6cc911.gif" width="100%"/></a><a href="#"><img src="http://randojs.com/images/dropShadow.png" width="100%"/></a></p><br/> |
| 17 | + |
| 18 | + |
| 19 | +<p align="center"><a href="https://codesandbox.io/s/browser-fingerprinting-generate-unique-device-id-or-browser-id-507n2v" target="_blank">CodeSandbox, </a> |
| 20 | +<a href="https://broprintjs.netlify.app/" target="_blank" >Live Demo</a> </p> |
| 21 | + |
| 22 | +## :hear_no_evil: What's all the hullabaloo? |
| 23 | +<a href="https://broprintjs.netlify.app/" target="_blank">Broprint.js</a> helps JavaScript developers code visitors identifier more simply, readably, and securely. Whether you need to find a unique visitor, do analytics, browser fingerprinting, or do anything of the like while even preventing frauds, we've got you covered at a **cryptographically strong** level. The best part? Our library is extremely lightweight and developer friendly- which means it won't take a toll on your project, and it's uber-simple to implement. This library works on the concept of **canvas** fingerprint and **audio** fingerprint, the final result which a user get is the combination of **audio and canvas fingerprint**. We are using **cryptojs** under the hood for encryptions but you can easily tweek the library to remove the dependency. <br/><br/><br/> |
| 24 | +</br> |
| 25 | + |
| 26 | +## :zap: Fast implementation |
| 27 | + **Step 1:** Install using npm or yarn:<br/> |
| 28 | + |
| 29 | +Using npm: |
| 30 | +```JavaScript |
| 31 | +//Install: |
| 32 | +npm i @rajesh896/browser-fingerprint |
| 33 | +``` |
| 34 | +Using Yarn: |
| 35 | +```Javascript |
| 36 | +//Install: |
| 37 | +yarn add @rajesh896/browser-fingerprint |
| 38 | +``` |
| 39 | +<br/><br/> |
| 40 | +## :tada: Examples |
| 41 | +>### **In Reactjs** |
| 42 | +```javascript |
| 43 | +import { getDeviceId } from "@rajesh896/browser-fingerprint"; |
| 44 | + |
| 45 | +getDeviceId().then((fingerprint) => { |
| 46 | + // fingerprint is your unique browser id. |
| 47 | + // This is well tested |
| 48 | + |
| 49 | + // the result you receive here is the combination of Canvas fingerprint and audio fingerprint. |
| 50 | +}) |
| 51 | +``` |
| 52 | +<br/> |
| 53 | + |
| 54 | +>### Using this script in the html files |
| 55 | + 1. Execute `npm i @rajesh896/browser-fingerprint` |
| 56 | + 2. Then - |
| 57 | +```html |
| 58 | +<!DOCTYPE html> |
| 59 | +<html lang="en"> |
| 60 | + |
| 61 | +<head> |
| 62 | + <meta charset="UTF-8"> |
| 63 | + <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| 64 | + <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 65 | + <title>FingerPrint</title> |
| 66 | +</head> |
| 67 | + |
| 68 | +<body> |
| 69 | + <script type="module"> |
| 70 | + import("./node_modules/@rajesh896/browser-fingerprint/index.js").then((module) => { |
| 71 | + module.getDeviceId().then((fingerprint) => { |
| 72 | + console.log(fingerprint); |
| 73 | + }) |
| 74 | + }) |
| 75 | + </script> |
| 76 | +</body> |
| 77 | + |
| 78 | +</html> |
| 79 | +``` |
| 80 | + |
| 81 | +- From version `1.1.0` onwards we have a dependency `crypto-js`. If you do not want to have this dependency then use the earlier versions of this library. |
| 82 | + |
| 83 | +If you want to use it in simple `.html` file, please read the `index.html` file in the root directory. |
| 84 | + |
| 85 | +This repository is for educational and demonstration purposes only! |
| 86 | + |
| 87 | +## :clap: Supporters |
| 88 | +[](https://github.com/Rajesh-Royal/Broprint.js/stargazers) |
| 89 | +[](https://github.com/Rajesh-Royal/Broprint.js/network/members) |
| 90 | +<p align="center"><a href="https://github.com/Rajesh-Royal/Broprint.js"><img src="http://randojs.com/images/barsSmallTransparentBackground.gif" alt="Animated footer bars" width="100%"/></a></p> |
| 91 | +<br/> |
| 92 | +<p align="center"><a href="Rajesh-Royal/Broprint.js#"><img src="http://randojs.com/images/backToTopButtonTransparentBackground.png" alt="Back to top" height="29"/></a></p> |
0 commit comments