Skip to content

Commit 8665be2

Browse files
committed
feat: enhance README with installation instructions and CDN usage
1 parent e811887 commit 8665be2

File tree

1 file changed

+50
-5
lines changed

1 file changed

+50
-5
lines changed

README.MD

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,18 @@
22
<p align="center">The world's easiest, smallest and powerful visitor identifier for browsers.</p>
33

44
<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">
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">
77
<img src="https://img.shields.io/npm/v/@rajesh896/broprint.js" alt="Current NPM version">
88
</a>
99
<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>
1010
</p><br/><br/>
1111

12-
1312
<p align="center">
1413
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>
1514

1615
<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/>
1716

18-
1917
<p align="center"><a href="https://codesandbox.io/s/browser-fingerprinting-generate-unique-device-id-or-browser-id-507n2v" target="_blank">CodeSandbox, </a>
2018
<a href="https://broprintjs.netlify.app/" target="_blank" >Live Demo</a> </p>
2119

@@ -24,25 +22,68 @@ This package generates a unique ID/String for different browsers. Like chrome, F
2422
> The algorithms used to encrypt/decrypt data - `murmurhash3_32_gc`, `cyrb53` and `javaHashCode`. Code is inside `.src/code/EncryptDecrypt.js`.
2523
2624
## :hear_no_evil: What's all the hullabaloo?
25+
2726
<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/>
2827
</br>
2928

3029
## :zap: Fast implementation
30+
3131
**Step 1:** Install using npm or yarn:<br/>
3232

3333
Using npm:
34+
3435
```JavaScript
3536
//Install:
3637
npm i @rajesh896/broprint.js
3738
```
39+
3840
Using Yarn:
41+
3942
```Javascript
4043
//Install:
4144
yarn add @rajesh896/broprint.js
4245
```
46+
**Step 1:** Install using npm, yarn, or use via CDN:<br/>
47+
48+
### Using npm:
49+
```sh
50+
npm i @rajesh896/broprint.js
51+
```
52+
53+
### Using Yarn:
54+
```sh
55+
yarn add @rajesh896/broprint.js
56+
```
57+
58+
### Using CDN (jsDelivr):
59+
You can load Broprint.js directly in the browser with a free CDN:
60+
61+
```html
62+
<script type="module">
63+
import { getCurrentBrowserFingerPrint } from 'https://cdn.jsdelivr.net/npm/@rajesh896/broprint.js@latest/lib/index.js';
64+
getCurrentBrowserFingerPrint().then(fingerprint => {
65+
console.log('Browser fingerprint:', fingerprint);
66+
});
67+
</script>
68+
```
69+
70+
Or, for classic script usage (exposes as a global):
71+
72+
```html
73+
<script src="https://cdn.jsdelivr.net/npm/@rajesh896/broprint.js@latest/lib/index.js"></script>
74+
<script>
75+
// If the library exposes a global (update if UMD/global build is added)
76+
// Example: window.getCurrentBrowserFingerPrint()
77+
</script>
78+
```
79+
<br/>
80+
4381
<br/><br/>
82+
4483
## :tada: Examples
84+
>
4585
>### **In Reactjs**
86+
4687
```javascript
4788
import { getCurrentBrowserFingerPrint } from "@rajesh896/broprint.js";
4889

@@ -53,11 +94,14 @@ getCurrentBrowserFingerPrint().then((fingerprint) => {
5394
// the result you receive here is the combination of Canvas fingerprint and audio fingerprint.
5495
})
5596
```
97+
5698
<br/>
5799

58100
>### Using this script in the html files
101+
59102
1. Execute `npm i @rajesh896/broprint.js`
60103
2. Then -
104+
61105
```html
62106
<!DOCTYPE html>
63107
<html lang="en">
@@ -82,13 +126,14 @@ getCurrentBrowserFingerPrint().then((fingerprint) => {
82126
</html>
83127
```
84128

85-
- 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.
129+
- 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.
86130

87131
If you want to use it in simple `.html` file, please read the `index.html` file in the root directory.
88132

89133
This repository is for educational and demonstration purposes only!
90134

91135
## :clap: Supporters
136+
92137
[![Stargazers repo roster for @Rajesh-Royal/Broprint.js](https://reporoster.com/stars/Rajesh-Royal/Broprint.js)](https://github.com/Rajesh-Royal/Broprint.js/stargazers)
93138
[![Forkers repo roster for @nRajesh-Royal/Broprint.js](https://reporoster.com/forks/Rajesh-Royal/Broprint.js)](https://github.com/Rajesh-Royal/Broprint.js/network/members)
94139
<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>

0 commit comments

Comments
 (0)