Skip to content

Commit 6f4bc72

Browse files
author
Inbal Tako
committed
Update readme
1 parent 630fbbf commit 6f4bc72

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,28 @@ use SecureNative\sdk\SecureNativeOptions;
7878
use SecureNative\sdk\EventTypes;
7979
use SecureNative\sdk\SecureNativeContext;
8080

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);
8489

8590
SecureNative::track(array(
8691
'event' => EventTypes::LOG_IN,
87-
'context' => ctx,
92+
'context' => $ctx,
8893
'userId' => '1234',
8994
'userTraits' => (object)[
9095
'name' => 'Your Name',
9196
'email' => 'name@gmail.com'
9297
],
9398
// Custom properties
9499
'properties' => (object)[
95-
"prop1" => "CUSTOM_PARAM_VALUE",
96-
"prop2" => true,
97-
"prop3" => 3
100+
"custom_param1" => "CUSTOM_PARAM_VALUE",
101+
"custom_param2" => true,
102+
"custom_param3" => 3
98103
]
99104
));
100105
```
@@ -117,9 +122,9 @@ SecureNative::track(array(
117122
],
118123
// Custom properties
119124
'properties' => (object)[
120-
"prop1" => "CUSTOM_PARAM_VALUE",
121-
"prop2" => true,
122-
"prop3" => 3
125+
"custom_param1" => "CUSTOM_PARAM_VALUE",
126+
"custom_param2" => true,
127+
"custom_param3" => 3
123128
]
124129
));
125130
```

0 commit comments

Comments
 (0)