[{"data":1,"prerenderedAt":625},["ShallowReactive",2],{"docs-nav-\u002Fdocs\u002Faccount-sharing\u002Flisten-to-events":3,"\u002Fdocs\u002Faccount-sharing\u002Flisten-to-events":92},[4],{"title":5,"path":6,"stem":7,"children":8,"page":46},"Account Sharing","\u002Fdocs\u002Faccount-sharing","1.docs\u002F2.account sharing",[9,13,17,21,47,72],{"title":10,"path":11,"stem":12},"How it works","\u002Fdocs\u002Faccount-sharing\u002Fhow-account-sharing-prevention-works","1.docs\u002F2.account sharing\u002F0.How account sharing prevention works",{"title":14,"path":15,"stem":16},"Quick start","\u002Fdocs\u002Faccount-sharing\u002Fquick-start","1.docs\u002F2.account sharing\u002F1.Quick start",{"title":18,"path":19,"stem":20},"Events & actions","\u002Fdocs\u002Faccount-sharing\u002Flisten-to-events","1.docs\u002F2.account sharing\u002F2.Listen to events",{"title":22,"path":23,"stem":24,"children":25,"page":46},"Concepts","\u002Fdocs\u002Faccount-sharing\u002Fconcepts","1.docs\u002F2.account sharing\u002F4.Concepts",[26,30,34,38,42],{"title":27,"path":28,"stem":29},"Challenges","\u002Fdocs\u002Faccount-sharing\u002Fconcepts\u002Fchallenges","1.docs\u002F2.account sharing\u002F4.Concepts\u002F0.challenges",{"title":31,"path":32,"stem":33},"Device limits","\u002Fdocs\u002Faccount-sharing\u002Fconcepts\u002Fconfigure-device-limits","1.docs\u002F2.account sharing\u002F4.Concepts\u002F1.configure-device-limits",{"title":35,"path":36,"stem":37},"Groups","\u002Fdocs\u002Faccount-sharing\u002Fconcepts\u002Fgroups","1.docs\u002F2.account sharing\u002F4.Concepts\u002F2.groups",{"title":39,"path":40,"stem":41},"Automatically detach devices","\u002Fdocs\u002Faccount-sharing\u002Fconcepts\u002Fautomatically-detaching-devices","1.docs\u002F2.account sharing\u002F4.Concepts\u002F3.automatically-detaching-devices",{"title":43,"path":44,"stem":45},"Excluded Devices","\u002Fdocs\u002Faccount-sharing\u002Fconcepts\u002Fexcluded-devices","1.docs\u002F2.account sharing\u002F4.Concepts\u002F4.excluded-devices",false,{"title":48,"path":49,"stem":50,"children":51,"page":46},"Advanced","\u002Fdocs\u002Faccount-sharing\u002Fadvanced","1.docs\u002F2.account sharing\u002F8.Advanced",[52,56,60,64,68],{"title":53,"path":54,"stem":55},"Signing the user out","\u002Fdocs\u002Faccount-sharing\u002Fadvanced\u002Fsigning-the-user-out","1.docs\u002F2.account sharing\u002F8.Advanced\u002F1.Signing the user out",{"title":57,"path":58,"stem":59},"Webhooks","\u002Fdocs\u002Faccount-sharing\u002Fadvanced\u002Fwebhooks","1.docs\u002F2.account sharing\u002F8.Advanced\u002F2.webhooks",{"title":61,"path":62,"stem":63},"Metadata","\u002Fdocs\u002Faccount-sharing\u002Fadvanced\u002Fusing-metadata","1.docs\u002F2.account sharing\u002F8.Advanced\u002F3.Using metadata",{"title":65,"path":66,"stem":67},"When to attach","\u002Fdocs\u002Faccount-sharing\u002Fadvanced\u002Fwhen-to-call-the-attach-function","1.docs\u002F2.account sharing\u002F8.Advanced\u002F5.When to call the attach function",{"title":69,"path":70,"stem":71},"Tracking conversions","\u002Fdocs\u002Faccount-sharing\u002Fadvanced\u002Ftracking-conversions","1.docs\u002F2.account sharing\u002F8.Advanced\u002F8.Tracking conversions",{"title":73,"path":74,"stem":75,"children":76,"page":46},"Signals","\u002Fdocs\u002Faccount-sharing\u002Fsignals","1.docs\u002F2.account sharing\u002F9.Signals",[77,81,85,89],{"title":78,"path":79,"stem":80},"High velocity","\u002Fdocs\u002Faccount-sharing\u002Fsignals\u002Fhigh-velocity","1.docs\u002F2.account sharing\u002F9.Signals\u002F1.High velocity",{"title":82,"path":83,"stem":84},"Impossible travel","\u002Fdocs\u002Faccount-sharing\u002Fsignals\u002Fimpossible-travel","1.docs\u002F2.account sharing\u002F9.Signals\u002F2.Impossible travel",{"title":86,"path":87,"stem":88},"Concurrency","\u002Fdocs\u002Faccount-sharing\u002Fsignals\u002Fconcurrency","1.docs\u002F2.account sharing\u002F9.Signals\u002F3.Concurrency",{"title":31,"path":90,"stem":91},"\u002Fdocs\u002Faccount-sharing\u002Fsignals\u002Fdevice-limits","1.docs\u002F2.account sharing\u002F9.Signals\u002F4.Device limits",{"id":93,"title":18,"body":94,"description":617,"extension":618,"meta":619,"navigation":621,"path":19,"seo":622,"sitemap":623,"stem":20,"__hash__":624},"docs\u002F1.docs\u002F2.account sharing\u002F2.Listen to events.md",{"type":95,"value":96,"toc":605},"minimark",[97,102,106,270,512,517,520,524,531,535,548,553,556,562,565,570,573,578,581,586,593,598,601],[98,99,101],"h1",{"id":100},"handle-events-actions","Handle events & actions",[103,104,105],"p",{},"Once Rupt is integrated into your website, it maps a user journey to a set of events. These events are emitted by the SDK and can be listened to by your application. Here is a list of events and user actions that can be listened to:",[107,108,109,128],"table",{},[110,111,112],"thead",{},[113,114,115,119,122,125],"tr",{},[116,117,118],"th",{},"Event",[116,120,121],{},"Initiator",[116,123,124],{},"Handler type",[116,126,127],{},"Description",[129,130,131,151,172,188,206,222,238,254],"tbody",{},[113,132,133,140,143,148],{},[134,135,136],"td",{},[137,138,139],"code",{},"on_limit_exceeded",[134,141,142],{},"SDK",[134,144,145],{},[137,146,147],{},"function",[134,149,150],{},"Called when the user exceeds the device limit.",[113,152,153,158,160,164],{},[134,154,155],{},[137,156,157],{},"on_challenge",[134,159,142],{},[134,161,162],{},[137,163,147],{},[134,165,166,167,171],{},"Called when Rupt determines that the user should be challenged (",[168,169,170],"a",{"href":28},"more about challenges here",").",[113,173,174,179,181,185],{},[134,175,176],{},[137,177,178],{},"on_current_device_logout",[134,180,142],{},[134,182,183],{},[137,184,147],{},[134,186,187],{},"Called right before the current device should be logged out.",[113,189,190,195,198,203],{},[134,191,192],{},[137,193,194],{},"redirect_urls.new_account_url",[134,196,197],{},"User",[134,199,200],{},[137,201,202],{},"url string",[134,204,205],{},"(required) A URL to redirect the user to if they want to stop account sharing and create a new account.",[113,207,208,213,215,219],{},[134,209,210],{},[137,211,212],{},"redirect_urls.logout_url",[134,214,197],{},[134,216,217],{},[137,218,202],{},[134,220,221],{},"(required) A URL to redirect the user to if they choose to logout or if they are kicked out by a verified owner.",[113,223,224,229,231,235],{},[134,225,226],{},[137,227,228],{},"redirect_urls.success_url",[134,230,142],{},[134,232,233],{},[137,234,202],{},[134,236,237],{},"(optional) A URL to redirect the user to if they are successfully verified and are within the device limit.",[113,239,240,245,247,251],{},[134,241,242],{},[137,243,244],{},"redirect_urls.suspended_url",[134,246,142],{},[134,248,249],{},[137,250,202],{},[134,252,253],{},"(optional) A URL to redirect the user to if they are suspended.",[113,255,256,261,263,267],{},[134,257,258],{},[137,259,260],{},"redirect_urls.upgrade_url",[134,262,142],{},[134,264,265],{},[137,266,202],{},[134,268,269],{},"(optional) A URL to redirect the user to if they choose to upgrade and skip a free trial (when challenged for multiple trials)",[271,272,277],"pre",{"className":273,"code":274,"language":275,"meta":276,"style":276},"language-js shiki shiki-themes one-dark-pro monokai","await Rupt.attach({\n  client_id: `your_api_client_id`,\n  account: `user_account_id`,\n  on_challenge: () => {\n    \u002F* optional *\u002F\n  },\n  on_limit_exceeded: () => {\n    \u002F* optional *\u002F\n  },\n  on_current_device_logout: ({ challenge }) => {\n    \u002F* optional *\u002F\n  },\n  redirect_urls: {\n    new_account_url: `https:\u002F\u002Fyourwebsite.com\u002Fnew-account`, \u002F\u002F required\n    logout_url: `https:\u002F\u002Fyourwebsite.com\u002Flogout`, \u002F\u002F required\n    success_url: `https:\u002F\u002Fyourwebsite.com\u002Fsuccess`, \u002F\u002F optional\n    suspended_url: `https:\u002F\u002Fyourwebsite.com\u002Fsuspended`, \u002F\u002F optional\n    upgrade_url: `https:\u002F\u002Fyourwebsite.com\u002Fupgrade`, \u002F\u002F optional\n  },\n});\n","js","",[137,278,279,303,320,333,349,356,362,374,379,384,404,409,414,423,440,455,471,486,501,506],{"__ignoreMap":276},[280,281,284,288,292,296,300],"span",{"class":282,"line":283},"line",1,[280,285,287],{"class":286},"sqnWQ","await",[280,289,291],{"class":290},"syDQ0"," Rupt",[280,293,295],{"class":294},"sFXR2",".",[280,297,299],{"class":298},"sUpKv","attach",[280,301,302],{"class":294},"({\n",[280,304,306,310,313,317],{"class":282,"line":305},2,[280,307,309],{"class":308},"sskXI","  client_id",[280,311,312],{"class":294},": ",[280,314,316],{"class":315},"sgpKs","`your_api_client_id`",[280,318,319],{"class":294},",\n",[280,321,323,326,328,331],{"class":282,"line":322},3,[280,324,325],{"class":308},"  account",[280,327,312],{"class":294},[280,329,330],{"class":315},"`user_account_id`",[280,332,319],{"class":294},[280,334,336,339,342,346],{"class":282,"line":335},4,[280,337,338],{"class":298},"  on_challenge",[280,340,341],{"class":294},": () ",[280,343,345],{"class":344},"sfrnW","=>",[280,347,348],{"class":294}," {\n",[280,350,352],{"class":282,"line":351},5,[280,353,355],{"class":354},"sDDnO","    \u002F* optional *\u002F\n",[280,357,359],{"class":282,"line":358},6,[280,360,361],{"class":294},"  },\n",[280,363,365,368,370,372],{"class":282,"line":364},7,[280,366,367],{"class":298},"  on_limit_exceeded",[280,369,341],{"class":294},[280,371,345],{"class":344},[280,373,348],{"class":294},[280,375,377],{"class":282,"line":376},8,[280,378,355],{"class":354},[280,380,382],{"class":282,"line":381},9,[280,383,361],{"class":294},[280,385,387,390,393,397,400,402],{"class":282,"line":386},10,[280,388,389],{"class":298},"  on_current_device_logout",[280,391,392],{"class":294},": ({ ",[280,394,396],{"class":395},"sLbzO","challenge",[280,398,399],{"class":294}," }) ",[280,401,345],{"class":344},[280,403,348],{"class":294},[280,405,407],{"class":282,"line":406},11,[280,408,355],{"class":354},[280,410,412],{"class":282,"line":411},12,[280,413,361],{"class":294},[280,415,417,420],{"class":282,"line":416},13,[280,418,419],{"class":308},"  redirect_urls",[280,421,422],{"class":294},": {\n",[280,424,426,429,431,434,437],{"class":282,"line":425},14,[280,427,428],{"class":308},"    new_account_url",[280,430,312],{"class":294},[280,432,433],{"class":315},"`https:\u002F\u002Fyourwebsite.com\u002Fnew-account`",[280,435,436],{"class":294},", ",[280,438,439],{"class":354},"\u002F\u002F required\n",[280,441,443,446,448,451,453],{"class":282,"line":442},15,[280,444,445],{"class":308},"    logout_url",[280,447,312],{"class":294},[280,449,450],{"class":315},"`https:\u002F\u002Fyourwebsite.com\u002Flogout`",[280,452,436],{"class":294},[280,454,439],{"class":354},[280,456,458,461,463,466,468],{"class":282,"line":457},16,[280,459,460],{"class":308},"    success_url",[280,462,312],{"class":294},[280,464,465],{"class":315},"`https:\u002F\u002Fyourwebsite.com\u002Fsuccess`",[280,467,436],{"class":294},[280,469,470],{"class":354},"\u002F\u002F optional\n",[280,472,474,477,479,482,484],{"class":282,"line":473},17,[280,475,476],{"class":308},"    suspended_url",[280,478,312],{"class":294},[280,480,481],{"class":315},"`https:\u002F\u002Fyourwebsite.com\u002Fsuspended`",[280,483,436],{"class":294},[280,485,470],{"class":354},[280,487,489,492,494,497,499],{"class":282,"line":488},18,[280,490,491],{"class":308},"    upgrade_url",[280,493,312],{"class":294},[280,495,496],{"class":315},"`https:\u002F\u002Fyourwebsite.com\u002Fupgrade`",[280,498,436],{"class":294},[280,500,470],{"class":354},[280,502,504],{"class":282,"line":503},19,[280,505,361],{"class":294},[280,507,509],{"class":282,"line":508},20,[280,510,511],{"class":294},"});\n",[513,514,515],"h2",{"id":139},[137,516,139],{},[103,518,519],{},"This is called when the user exceeds the device limit. This is an informational callback and does not affect the user journey. You can use this callback to do any internal work or for custom conversion journeys.",[513,521,522],{"id":157},[137,523,157],{},[103,525,526,527,530],{},"This is called when Rupt determines that the user should be challenged. This can happen if the account has too many people or too many devices attached to it. You can use this callback to do any internal work before the user is redirect to the challenge page. If this function returns ",[137,528,529],{},"false",", the user will not be redirected to the challenge page.",[513,532,533],{"id":178},[137,534,178],{},[103,536,537,538,541,542,544,545,547],{},"This is called right before a device should be logged out. This logout action can be a result of a user kicking out this devices via a challenge, or simply a manual ",[137,539,540],{},".detach"," call. This function provides a ",[137,543,396],{}," parameter to distinguish between the two cases.\nYou can use this callback to do any internal work before the user is redirect to the logout page (or log them out manually). If this function returns ",[137,546,529],{},", the user will not be redirected to the logout page.",[513,549,551],{"id":550},"redirect_urls",[137,552,550],{},[103,554,555],{},"These are the URLs that Rupt will redirect the user to when certain events happen. Some URLs are required for a complete experience. Others are optional and can be used to customize the user journey.",[557,558,560],"h3",{"id":559},"redirect_urlsnew_account_url",[137,561,194],{},[103,563,564],{},"This is the URL that Rupt will redirect the user to if they want to stop account sharing and create a new account. This URL is required.",[557,566,568],{"id":567},"redirect_urlslogout_url",[137,569,212],{},[103,571,572],{},"This is the URL that Rupt will redirect the user to if they choose to logout or if they are kicked out by a verified owner. This URL is required. If the logout is triggered from a challenge, the ID of the challenge will be appended to the logout url.",[557,574,576],{"id":575},"redirect_urlssuccess_url",[137,577,228],{},[103,579,580],{},"This is the URL that Rupt will redirect the user to if they are successfully verified and are within the device limit. This URL is optional. If this URL is not provided, Rupt will redirect the user to the url they were on before they were redirected to the Rupt challenge page.",[557,582,584],{"id":583},"redirect_urlssuspended_url",[137,585,244],{},[103,587,588,589,295],{},"This is the URL that Rupt will redirect the user to if they are suspended. This URL is optional. If this URL is not provided, Rupt will redirect the user to the hosted & branded suspended page. You can learn more about suspended pages ",[168,590,592],{"href":591},"\u002Fdocs\u002Fadvanced\u002Fsuspend","here",[557,594,596],{"id":595},"redirect_urlsupgrade_url",[137,597,260],{},[103,599,600],{},"A URL to redirect the user to if they choose to upgrade. This URL is optional. If this URL is not provided, Rupt will not show an account upgrade redirect button on the Rupt challenge page.",[602,603,604],"style",{},"html pre.shiki code .sqnWQ, html code.shiki .sqnWQ{--shiki-default:#C678DD;--shiki-dark:#F92672}html pre.shiki code .syDQ0, html code.shiki .syDQ0{--shiki-default:#E5C07B;--shiki-dark:#F8F8F2}html pre.shiki code .sFXR2, html code.shiki .sFXR2{--shiki-default:#ABB2BF;--shiki-dark:#F8F8F2}html pre.shiki code .sUpKv, html code.shiki .sUpKv{--shiki-default:#61AFEF;--shiki-dark:#A6E22E}html pre.shiki code .sskXI, html code.shiki .sskXI{--shiki-default:#E06C75;--shiki-dark:#F8F8F2}html pre.shiki code .sgpKs, html code.shiki .sgpKs{--shiki-default:#98C379;--shiki-dark:#E6DB74}html pre.shiki code .sfrnW, html code.shiki .sfrnW{--shiki-default:#C678DD;--shiki-default-font-style:inherit;--shiki-dark:#66D9EF;--shiki-dark-font-style:italic}html pre.shiki code .sDDnO, html code.shiki .sDDnO{--shiki-default:#7F848E;--shiki-default-font-style:italic;--shiki-dark:#88846F;--shiki-dark-font-style:inherit}html pre.shiki code .sLbzO, html code.shiki .sLbzO{--shiki-default:#E06C75;--shiki-default-font-style:italic;--shiki-dark:#FD971F;--shiki-dark-font-style:italic}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":276,"searchDepth":305,"depth":305,"links":606},[607,608,609,610],{"id":139,"depth":305,"text":139},{"id":157,"depth":305,"text":157},{"id":178,"depth":305,"text":178},{"id":550,"depth":305,"text":550,"children":611},[612,613,614,615,616],{"id":559,"depth":322,"text":194},{"id":567,"depth":322,"text":212},{"id":575,"depth":322,"text":228},{"id":583,"depth":322,"text":244},{"id":595,"depth":322,"text":260},"Listen to events emitted by the Rupt JavaScript SDK","md",{"head":620},{"title":101},true,{"title":18,"description":617},{"loc":19},"H-s47wFka9UtqZycC9CkA5S8_m77ISK3gfiJ4Sg3K80",1776564888064]