@@ -68,9 +68,9 @@ Attach `securenative.json` file to your root folder:
6868
6969``` json
7070{
71- "SECURENATIVE_API_KEY" : " SOME_API_KEY " ,
72- "SECURENATIVE_APP_NAME" : " SOME_APP_NAME " ,
73- "SECURENATIVE_API_URL" : " SOME_API_URL " ,
71+ "SECURENATIVE_API_KEY" : " YOUR_API_KEY " ,
72+ "SECURENATIVE_APP_NAME" : " APP_NAME " ,
73+ "SECURENATIVE_API_URL" : " API_URL " ,
7474 "SECURENATIVE_INTERVAL" : 1000 ,
7575 "SECURENATIVE_MAX_EVENTS" : 100 ,
7676 "SECURENATIVE_TIMEOUT" : 1500 ,
@@ -161,10 +161,12 @@ SecureNative::track(array(
161161** Example**
162162
163163``` php
164+ $options = new SecureNativeOptions();
165+
164166$ver = SecureNative::verify(array(
165167 'event' => EventTypes::VERIFY,
166168 'userId' => '1234',
167- 'context' => SecureNativeContext ::fromRequest(),
169+ 'context' => SecureNative ::fromRequest(),
168170 'userTraits' => (object)[
169171 'name' => 'Your Name',
170172 'email' => 'name@gmail.com'
@@ -187,3 +189,27 @@ if ($verified) {
187189 // Request is trusted (coming from SecureNative)
188190}
189191 ```
192+
193+ ## Extract proxy headers from cloud providers
194+
195+ You can specify custom header keys to allow extraction of client ip from different providers.
196+ This example demonstrates the usage of proxy headers for ip extraction from Cloudflare.
197+
198+ ### Option 1: Using config file
199+ ``` json
200+ {
201+ "SECURENATIVE_API_KEY" : " YOUR_API_KEY" ,
202+ "SECURENATIVE_PROXY_HEADERS" : [" CF-Connecting-IP" ]
203+ }
204+ ```
205+
206+ Initialize sdk as shown above.
207+
208+ ### Options 2: Using ConfigurationBuilder
209+
210+ ``` php
211+ $options = new SecureNativeOptions();
212+ $options->setProxyHeaders(["CF-Connecting-IP"]);
213+
214+ SecureNative::init();
215+ ```
0 commit comments