@@ -88,18 +88,8 @@ from securenative.models.user_traits import UserTraits
8888
8989securenative = SecureNative.get_instance()
9090
91- context = SecureNative.context_builder().\
92- with_ip(" 127.0.0.1" ).\
93- with_client_token(" SECURED_CLIENT_TOKEN" ).\
94- with_headers({" user-agent" , " Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405" }).\
95- build()
96-
97- event_options = EventOptionsBuilder(EventTypes.LOG_IN ).\
98- with_user_id(" 1234" ).\
99- with_user_traits(UserTraits(" Your Name" , " name@gmail.com" , " +1234567890" )).\
100- with_context(context).\
101- with_properties({" prop1" : " CUSTOM_PARAM_VALUE" , " prop2" : True , " prop3" : 3 }).\
102- build()
91+ context = SecureNative.context_builder().with_ip(" 127.0.0.1" ).with_client_token(" SECURED_CLIENT_TOKEN" ).with_headers({" user-agent" , " Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405" }).build()
92+ event_options = EventOptionsBuilder(EventTypes.LOG_IN ).with_user_id(" 1234" ).with_user_traits(UserTraits(" Your Name" , " name@gmail.com" , " +1234567890" )).with_context(context).with_properties({" prop1" : " CUSTOM_PARAM_VALUE" , " prop2" : True , " prop3" : 3 }).build()
10393
10494securenative.track(event_options)
10595 ```
@@ -115,14 +105,9 @@ from securenative.models.user_traits import UserTraits
115105
116106def track (request ):
117107 securenative = SecureNative.get_instance()
118- context = SecureNative.context_builder().from_http_request(request).build()
119108
120- event_options = EventOptionsBuilder(EventTypes.LOG_IN ).\
121- with_user_id(" 1234" ).\
122- with_user_traits(UserTraits(" Your Name" , " name@gmail.com" , " +1234567890" )).\
123- with_context(context).\
124- with_properties({" prop1" : " CUSTOM_PARAM_VALUE" , " prop2" : True , " prop3" : 3 }).\
125- build()
109+ context = SecureNative.context_builder().from_http_request(request).build()
110+ event_options = EventOptionsBuilder(EventTypes.LOG_IN ).with_user_id(" 1234" ).with_user_traits(UserTraits(" Your Name" , " name@gmail.com" , " +1234567890" )).with_context(context).with_properties({" prop1" : " CUSTOM_PARAM_VALUE" , " prop2" : True , " prop3" : 3 }).build()
126111
127112 securenative.track(event_options)
128113```
@@ -142,12 +127,7 @@ def track(request):
142127 securenative = SecureNative.get_instance()
143128 context = SecureNative.context_builder().from_http_request(request).build()
144129
145- event_options = EventOptionsBuilder(EventTypes.LOG_IN ).\
146- with_user_id(" 1234" ).\
147- with_user_traits(UserTraits(" Your Name" , " name@gmail.com" , " +1234567890" )).\
148- with_context(context).\
149- with_properties({" prop1" : " CUSTOM_PARAM_VALUE" , " prop2" : True , " prop3" : 3 }).\
150- build()
130+ event_options = EventOptionsBuilder(EventTypes.LOG_IN ).with_user_id(" 1234" ).with_user_traits(UserTraits(" Your Name" , " name@gmail.com" , " +1234567890" )).with_context(context).with_properties({" prop1" : " CUSTOM_PARAM_VALUE" , " prop2" : True , " prop3" : 3 }).build()
151131
152132 verify_result = securenative.verify(event_options)
153133 verify_result.risk_level # Low, Medium, High
0 commit comments