Skip to content

Commit 7876456

Browse files
committed
Update build script, dependencies, and README.md file
1 parent a354133 commit 7876456

5 files changed

Lines changed: 2816 additions & 6666 deletions

File tree

README.md

Lines changed: 71 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The official Javascript package of Greip API
1212

1313
[![NPM Package of Greip](https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/package/greip.js)
1414
[![Github Repository](https://img.shields.io/badge/GitHub-100000?style=for-the-badge&logo=github&logoColor=white)](https://github.com/Greipio/javascript)
15+
[![jsDelivery CDN Link](https://img.shields.io/badge/jsDelivr-E84D3D?style=for-the-badge&logo=jsDelivr&logoColor=white)](https://cdn.jsdelivr.net/gh/Greipio/javascript/greip.bundle.js)
1516

1617
[![npm version](https://badge.fury.io/js/greip.js.svg)](https://badge.fury.io/js/greip.js)
1718
  
@@ -25,7 +26,7 @@ The official Javascript package of Greip API
2526

2627
## Installation
2728

28-
For Node.js, React.js & React Native:
29+
### 1. For React.js, React Native, etc:
2930

3031
```
3132
npm i greip.js --save
@@ -37,15 +38,61 @@ or
3738
yarn add greip.js
3839
```
3940

41+
### 2. For CDN Integration
42+
43+
```html
44+
<script src="https://cdn.jsdelivr.net/gh/Greipio/javascript/greip.bundle.js" type="text/javascript" />
45+
```
46+
47+
### 3. For Node.js
48+
49+
Please use our [Node.js library](https://github.com/Greipio/node) instead.
50+
51+
## Initializing the Greip object
52+
53+
There're two different ways to initialize the Greip object, let's dive into this:
54+
55+
### 1. For React.js, React Native, etc:
56+
57+
```javascript
58+
import {
59+
Lookup,
60+
GeoIP,
61+
BulkLookup,
62+
ASN,
63+
BadWord,
64+
Country,
65+
EmailValidation,
66+
PhoneValidation,
67+
PaymentFraud,
68+
IBANValidation,
69+
} from 'greip.js';
70+
```
71+
72+
### 2. CDN Integration
73+
74+
In CDN integration, you already have `Greip` as a global variable initialized automatically when the page loads.
75+
76+
You can start using it directly as follows:
77+
78+
```javascript
79+
Greip.GeoIP({
80+
key: 'your-api-key',
81+
// other options here
82+
}).then((response) => {
83+
console.log(response);
84+
});
85+
```
86+
4087
## Usage
4188
4289
Here's how you use the API Methods:
4390
4491
### 1. IP Geolocation Method
4592
46-
```javascript
47-
import { GeoIP } from 'greip.js';
93+
Use this method to retrieve the IP address of the visitor/user with its full information.
4894
95+
```javascript
4996
await GeoIP({
5097
key: 'your-api-key',
5198
})
@@ -59,9 +106,9 @@ await GeoIP({
59106
60107
### 2. IP Lookup Method
61108
62-
```javascript
63-
import { Lookup } from 'greip.js';
109+
Use this method to retrieve the information of a given IP address.
64110
111+
```javascript
65112
await Lookup({
66113
key: 'your-api-key',
67114
ip: '1.1.1.1',
@@ -76,9 +123,9 @@ await Lookup({
76123
77124
### 3. Bulk IP Lookup Method
78125
79-
```javascript
80-
import { BulkLookup } from 'greip.js';
126+
You can use this method to retrieve the information of multiple IP addresses (no need to use the `Lookup` method inside a loop).
81127
128+
```javascript
82129
await BulkLookup({
83130
key: 'your-api-key',
84131
ips: ['1.1.1.1', '2.2.2.2'],
@@ -93,9 +140,9 @@ await BulkLookup({
93140
94141
### 4. ASN Lookup Method
95142
96-
```javascript
97-
import { ASN } from 'greip.js';
143+
In this method, Greip will help you lookup any given AS Number and returning all data related to it, like: name, org (the organization name), country, domain, email, phone, totalIPs, list of all routes (v4 & v6) related the given AS Number, etc.
98144
145+
```javascript
99146
await ASN({
100147
key: 'your-api-key',
101148
asn: 'AS01',
@@ -110,9 +157,9 @@ await ASN({
110157
111158
### 5. Profanity Detection Method
112159
113-
```javascript
114-
import { BadWord } from 'greip.js';
160+
This method can be used to detect abuse of your website/app. It’s a great way to know more about your user inputs and whether they contain profanity (bad words) or not before releasing them to the public.
115161
162+
```javascript
116163
await BadWord({
117164
key: 'your-api-key',
118165
text: 'This is just normal sample text.',
@@ -127,9 +174,9 @@ await BadWord({
127174
128175
### 6. Country Lookup Method
129176
130-
```javascript
131-
import { Country } from 'greip.js';
177+
This method can help you retrieve information of the given country.
132178
179+
```javascript
133180
await Country({
134181
key: 'your-api-key',
135182
countryCode: 'SA',
@@ -144,9 +191,11 @@ await Country({
144191
145192
### 7. Email Validation Method
146193
147-
```javascript
148-
import { EmailValidation } from 'greip.js';
194+
This method provides an additional layer of validation for your system. While validating email syntax is important, it is not sufficient.
195+
196+
This method goes beyond syntax validation by checking the domain’s validity, the availability of the Mail Service, detecting Disposable Email (Temporary Emails), etc. By utilising this method, you can ensure a more thorough validation process for email addresses.
149197
198+
```javascript
150199
await EmailValidation({
151200
key: 'your-api-key',
152201
email: 'name@domain.com',
@@ -161,9 +210,9 @@ await EmailValidation({
161210
162211
### 8. Phone Validation Method
163212
164-
```javascript
165-
import { PhoneValidation } from 'greip.js';
213+
This method can be used as an extra-layer of your system for validating phone numbers. It validates phone number syntax and valid-possibility.
166214
215+
```javascript
167216
await PhoneValidation({
168217
key: 'your-api-key',
169218
phone: '123123123',
@@ -179,9 +228,9 @@ await PhoneValidation({
179228
180229
### 9. Payment Fraud Prevention Method
181230
182-
```javascript
183-
import { PaymentFraud } from 'greip.js';
231+
Prevent financial losses by deploying AI-Powered modules.
184232
233+
```javascript
185234
await PaymentFraud({
186235
key: 'your-api-key',
187236
data: {
@@ -256,6 +305,8 @@ await PaymentFraud({
256305
257306
### 10. IBAN Validation Method
258307
308+
This method allows you to validate International Bank Account Numbers (IBANs) and retrieve additional information about the country associated with the IBAN.
309+
259310
```javascript
260311
await IBANValidation({
261312
key: 'your-api-key',
@@ -271,7 +322,7 @@ await IBANValidation({
271322
272323
## Options, Methods and More
273324
274-
You can find the full guide of this package by visiting our [Documentation Page](https://docs.greip.io/).
325+
You can find the full guide of this package by visiting our [documentation page](https://docs.greip.io/).
275326
276327
## Credits
277328

0 commit comments

Comments
 (0)