You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+71-20Lines changed: 71 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ The official Javascript package of Greip API
12
12
13
13
[](https://www.npmjs.com/package/greip.js)
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
+
40
87
## Usage
41
88
42
89
Here's how you use the API Methods:
43
90
44
91
### 1. IP Geolocation Method
45
92
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.
48
94
95
+
```javascript
49
96
awaitGeoIP({
50
97
key:'your-api-key',
51
98
})
@@ -59,9 +106,9 @@ await GeoIP({
59
106
60
107
### 2. IP Lookup Method
61
108
62
-
```javascript
63
-
import { Lookup } from'greip.js';
109
+
Use this method to retrieve the information of a given IP address.
64
110
111
+
```javascript
65
112
awaitLookup({
66
113
key:'your-api-key',
67
114
ip:'1.1.1.1',
@@ -76,9 +123,9 @@ await Lookup({
76
123
77
124
### 3. Bulk IP Lookup Method
78
125
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).
81
127
128
+
```javascript
82
129
awaitBulkLookup({
83
130
key:'your-api-key',
84
131
ips: ['1.1.1.1', '2.2.2.2'],
@@ -93,9 +140,9 @@ await BulkLookup({
93
140
94
141
### 4. ASN Lookup Method
95
142
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.
98
144
145
+
```javascript
99
146
awaitASN({
100
147
key:'your-api-key',
101
148
asn:'AS01',
@@ -110,9 +157,9 @@ await ASN({
110
157
111
158
### 5. Profanity Detection Method
112
159
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.
115
161
162
+
```javascript
116
163
awaitBadWord({
117
164
key:'your-api-key',
118
165
text:'This is just normal sample text.',
@@ -127,9 +174,9 @@ await BadWord({
127
174
128
175
### 6. Country Lookup Method
129
176
130
-
```javascript
131
-
import { Country } from'greip.js';
177
+
This method can help you retrieve information of the given country.
132
178
179
+
```javascript
133
180
awaitCountry({
134
181
key:'your-api-key',
135
182
countryCode:'SA',
@@ -144,9 +191,11 @@ await Country({
144
191
145
192
### 7. Email Validation Method
146
193
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.
149
197
198
+
```javascript
150
199
awaitEmailValidation({
151
200
key:'your-api-key',
152
201
email:'name@domain.com',
@@ -161,9 +210,9 @@ await EmailValidation({
161
210
162
211
### 8. Phone Validation Method
163
212
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.
166
214
215
+
```javascript
167
216
awaitPhoneValidation({
168
217
key:'your-api-key',
169
218
phone:'123123123',
@@ -179,9 +228,9 @@ await PhoneValidation({
179
228
180
229
### 9. Payment Fraud Prevention Method
181
230
182
-
```javascript
183
-
import { PaymentFraud } from'greip.js';
231
+
Prevent financial losses by deploying AI-Powered modules.
184
232
233
+
```javascript
185
234
awaitPaymentFraud({
186
235
key:'your-api-key',
187
236
data: {
@@ -256,6 +305,8 @@ await PaymentFraud({
256
305
257
306
### 10. IBAN Validation Method
258
307
308
+
This method allows you to validate International Bank Account Numbers (IBANs) and retrieve additional information about the country associated with the IBAN.
309
+
259
310
```javascript
260
311
awaitIBANValidation({
261
312
key:'your-api-key',
@@ -271,7 +322,7 @@ await IBANValidation({
271
322
272
323
## Options, Methods and More
273
324
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/).
0 commit comments