File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 refresh_interval = 3 )
1414
1515 # Server Side SDK Key for your project and environment
16- SDK_KEY = 'server-b8b7c58417680d9e76b1b8454326f357296b5003 '
16+ SDK_KEY = 'server-8ed48815ef044428826787e9a238b9c6a479f98c '
1717 with fp .Client (SDK_KEY , config ) as client :
18- # create one user
19- # key is for percentage rollout, normally use userId as key
20- user = fp .User ().stable_rollout ('00001' ).with_attr ('userId' , '00001' )
18+ # Create one user
19+ user = fp .User ().with_attr ('userId' , '00001' ) # "userId" is used in rules, should be filled in.
2120
22- # Toggle you want to use
23- TOGGLE_KEY = 'feature_toggle02 '
21+ # Get toggle result for this user.
22+ TOGGLE_KEY = 'campaign_allow_list '
2423
25- # get toggle result for this user
24+ # Get toggle result for this user
2625 is_open = client .value (TOGGLE_KEY , user , default = False )
2726 print ('feature for this user is: ' + str (is_open ))
2827
28+ # Demo of Detail function
2929 is_open_detail = client .value_detail (TOGGLE_KEY , user , default = False )
3030 print ('detail: ' + str (is_open_detail .reason ))
3131 print ('rule index: ' + str (is_open_detail .rule_index ))
You can’t perform that action at this time.
0 commit comments