[{"data":1,"prerenderedAt":369},["ShallowReactive",2],{"docs-nav":3,"docs-\u002Fdocs\u002Fapi\u002Fevents":70},[4,10,14,19,23,26,29,33,36,40,43,47,50,54,58,62,66],{"title":5,"path":6,"order":7,"section":8,"group":9},"Concepts","\u002Fdocs\u002Fapi\u002Fconcepts",1,"api",null,{"title":11,"path":12,"order":7,"section":13,"group":9},"Introduction","\u002Fdocs","general",{"title":15,"path":16,"order":7,"section":17,"group":18},"Usage","\u002Fdocs\u002Fsdk\u002Fusage","sdk","Script",{"title":20,"path":21,"order":22,"section":8,"group":9},"\u002Fv1\u002Fme","\u002Fdocs\u002Fapi\u002Fme",2,{"title":24,"path":25,"order":22,"section":13,"group":9},"Getting started","\u002Fdocs\u002Fgetting-started",{"title":24,"path":27,"order":22,"section":17,"group":28},"\u002Fdocs\u002Fsdk\u002Fpackage","Package",{"title":30,"path":31,"order":32,"section":8,"group":9},"\u002Fv1\u002Fsubscribe","\u002Fdocs\u002Fapi\u002Fsubscribe",3,{"title":34,"path":35,"order":32,"section":17,"group":28},"Browser client","\u002Fdocs\u002Fsdk\u002Fpackage\u002Fclient",{"title":37,"path":38,"order":39,"section":8,"group":9},"\u002Fv1\u002Funsubscribe","\u002Fdocs\u002Fapi\u002Funsubscribe",4,{"title":41,"path":42,"order":39,"section":17,"group":28},"Server client","\u002Fdocs\u002Fsdk\u002Fpackage\u002Fserver",{"title":44,"path":45,"order":46,"section":8,"group":9},"\u002Fv1\u002Fevents","\u002Fdocs\u002Fapi\u002Fevents",5,{"title":48,"path":49,"order":46,"section":17,"group":28},"Types","\u002Fdocs\u002Fsdk\u002Fpackage\u002Ftypes",{"title":51,"path":52,"order":53,"section":8,"group":9},"\u002Fv1\u002Fsend","\u002Fdocs\u002Fapi\u002Fsend",6,{"title":55,"path":56,"order":57,"section":8,"group":9},"\u002Fv1\u002Fbroadcasts","\u002Fdocs\u002Fapi\u002Fbroadcasts",7,{"title":59,"path":60,"order":61,"section":8,"group":9},"\u002Fv1\u002Fgroups","\u002Fdocs\u002Fapi\u002Fgroups",8,{"title":63,"path":64,"order":65,"section":8,"group":9},"\u002Fv1\u002Fsubscribers","\u002Fdocs\u002Fapi\u002Fsubscribers",9,{"title":67,"path":68,"order":69,"section":8,"group":9},"Webhooks","\u002Fdocs\u002Fapi\u002Fwebhooks",10,{"id":71,"title":44,"apiModule":9,"body":72,"description":361,"extension":362,"generated":363,"group":9,"meta":364,"navigation":365,"order":46,"path":45,"section":8,"seo":366,"stem":367,"__hash__":368},"docs\u002Fdocs\u002Fapi\u002Fevents.md",{"type":73,"value":74,"toc":358},"minimark",[75,82,96,103,122,143,152,157,241,246,272,281,312,319,354],[76,77,79],"h1",{"id":78},"v1events",[80,81,44],"code",{},[83,84,85,86,89,90,95],"p",{},"Project auth (",[80,87,88],{},"?project="," required). See ",[91,92,94],"a",{"href":93},"\u002Fdocs\u002Fapi\u002Fconcepts#authentication","Concepts → Authentication",".",[97,98,100],"h2",{"id":99},"post-v1events",[80,101,102],{},"POST \u002Fv1\u002Fevents",[83,104,105,109,110,113,114,117,118,121],{},[106,107,108],"strong",{},"What it does:"," Records a ",[80,111,112],{},"clicked"," or ",[80,115,116],{},"dismissed"," event against a broadcast. If the project has ",[91,119,120],{"href":68},"webhooks"," configured, fires a delivery to the customer's webhook URL.",[83,123,124,127,128,131,132,135,136,139,140,142],{},[106,125,126],{},"When to use it:"," Never directly. The pre-built service worker at ",[80,129,130],{},"litepush.dev\u002Flitepush-sw.js"," beacons this on ",[80,133,134],{},"notificationclick"," and ",[80,137,138],{},"notificationclose",". The endpoint silently drops requests that don't come with the right ",[80,141,88],{}," and a broadcast belonging to that project — manual calls without those will succeed-looking but no event is recorded.",[83,144,145,148,149,151],{},[106,146,147],{},"Authentication:"," Project — ",[80,150,88],{}," is required. The broadcast referenced in the body must also belong to that project.",[83,153,154],{},[106,155,156],{},"Request body:",[158,159,160,179],"table",{},[161,162,163],"thead",{},[164,165,166,170,173,176],"tr",{},[167,168,169],"th",{},"Field",[167,171,172],{},"Type",[167,174,175],{},"Required",[167,177,178],{},"Description",[180,181,182,201,223],"tbody",{},[164,183,184,190,195,198],{},[185,186,187],"td",{},[80,188,189],{},"type",[185,191,192],{},[80,193,194],{},"'clicked' | 'dismissed'",[185,196,197],{},"yes",[185,199,200],{},"Event type.",[164,202,203,208,211,213],{},[185,204,205],{},[80,206,207],{},"broadcast_id",[185,209,210],{},"string",[185,212,197],{},[185,214,215,216,219,220,95],{},"The ",[80,217,218],{},"bdc_*"," ID the notification came from. The service worker reads this from ",[80,221,222],{},"event.notification.data.bid",[164,224,225,230,232,235],{},[185,226,227],{},[80,228,229],{},"subscriber_id",[185,231,210],{},[185,233,234],{},"no",[185,236,215,237,240],{},[80,238,239],{},"sub_*"," ID of the receiver, if your SW knows it.",[83,242,243],{},[106,244,245],{},"Example (illustrative — your SW handles this):",[247,248,253],"pre",{"className":249,"code":250,"language":251,"meta":252,"style":252},"language-sh shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST 'https:\u002F\u002Fapi.litepush.dev\u002Fv1\u002Fevents?project=prj_xxxxxxxx' \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"type\": \"clicked\", \"broadcast_id\": \"bdc_01HXM...\" }'\n","sh","",[80,254,255,262,267],{"__ignoreMap":252},[256,257,259],"span",{"class":258,"line":7},"line",[256,260,261],{},"curl -X POST 'https:\u002F\u002Fapi.litepush.dev\u002Fv1\u002Fevents?project=prj_xxxxxxxx' \\\n",[256,263,264],{"class":258,"line":22},[256,265,266],{},"  -H \"Content-Type: application\u002Fjson\" \\\n",[256,268,269],{"class":258,"line":32},[256,270,271],{},"  -d '{ \"type\": \"clicked\", \"broadcast_id\": \"bdc_01HXM...\" }'\n",[83,273,274],{},[106,275,276,277,280],{},"Success — ",[80,278,279],{},"202 Accepted",":",[247,282,286],{"className":283,"code":284,"language":285,"meta":252,"style":252},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{ \"ok\": true }\n","json",[80,287,288],{"__ignoreMap":252},[256,289,290,294,297,301,304,306,309],{"class":258,"line":7},[256,291,293],{"class":292},"sMK4o","{",[256,295,296],{"class":292}," \"",[256,298,300],{"class":299},"spNyl","ok",[256,302,303],{"class":292},"\"",[256,305,280],{"class":292},[256,307,308],{"class":292}," true",[256,310,311],{"class":292}," }\n",[83,313,314,315,318],{},"Always returns ",[80,316,317],{},"202"," (even on silent drops) so it never noises up service-worker logs.",[320,321,322],"blockquote",{},[83,323,324,327,328,330,331,333,334,135,337,340,341,343,344,330,347,350,351,95],{},[106,325,326],{},"Attribution caveat."," The service worker only knows the broadcast, not which subscriber it's running for — so ",[80,329,112],{}," \u002F ",[80,332,116],{}," events carry ",[80,335,336],{},"subscriber_id: null",[80,338,339],{},"external_id: null"," downstream. Correlate them by ",[80,342,207],{},". Only ",[80,345,346],{},"delivered",[80,348,349],{},"failed"," (emitted server-side during fan-out) carry the full subscriber identity. See ",[91,352,67],{"href":353},"\u002Fdocs\u002Fapi\u002Fwebhooks#payload-shape",[355,356,357],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}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);}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":252,"searchDepth":22,"depth":22,"links":359},[360],{"id":99,"depth":22,"text":102},"The service-worker click\u002Fdismiss beacon. SDK-internal; fires webhooks when configured.","md",false,{},true,{"title":44,"description":361},"docs\u002Fapi\u002Fevents","vqKVqnqspz1Tq3Ml1SkS9Kc9YSR4WhT5jz0CdrhPEuU",1780560203630]