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
+13-8Lines changed: 13 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,13 +78,18 @@ use SecureNative\sdk\SecureNativeOptions;
78
78
use SecureNative\sdk\EventTypes;
79
79
use SecureNative\sdk\SecureNativeContext;
80
80
81
-
82
-
$token = "[SECURED_CLIENT_TOKEN]";
83
-
$ctx = new SecureNativeContext($token, "79.179.88.157", null, (object)["user-agent" => "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us"], null, null, null);
81
+
$clientToken = "SECURED_CLIENT_TOKEN"
82
+
$headers = (object)["user-agent" => "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us"] // User-Agent header is important to get device information!
83
+
$ip = "127.0.0.1"
84
+
$remoteIp = "127.0.0.1"
85
+
$url = null
86
+
$method = null
87
+
$body = null
88
+
$ctx = new SecureNativeContext($clientToken, $ip, $remoteIp, $headers, $url, $method, $body);
84
89
85
90
SecureNative::track(array(
86
91
'event' => EventTypes::LOG_IN,
87
-
'context' => ctx,
92
+
'context' => $ctx,
88
93
'userId' => '1234',
89
94
'userTraits' => (object)[
90
95
'name' => 'Your Name',
@@ -159,17 +164,17 @@ use SecureNative\sdk\SecureNativeContext;
159
164
160
165
$ver = SecureNative::verify(array(
161
166
'event' => EventTypes::VERIFY,
162
-
'userId' => '27',
167
+
'userId' => '1234',
163
168
'context' => SecureNativeContext::fromRequest(),
164
169
'userTraits' => (object)[
165
170
'name' => 'Your Name',
166
171
'email' => 'name@gmail.com'
167
172
]
168
173
));
169
174
170
-
ver.riskLevel // Low, Medium, High
171
-
ver.score // Risk score: 0 - 1 (0 - Very Low, 1 - Very High)
172
-
ver.triggers // ["TOR", "New IP", "New City"]
175
+
$ver.riskLevel // Low, Medium, High
176
+
$ver.score // Risk score: 0 - 1 (0 - Very Low, 1 - Very High)
0 commit comments