[{"data":1,"prerenderedAt":502},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fgetting-started\u002Ftesting":81,"\u002Fdocs\u002Fgetting-started\u002Ftesting-surround":497},[4],{"title":5,"path":6,"stem":7,"children":8},"Docs","\u002Fdocs","docs",[9,13,61],{"title":10,"path":6,"stem":11,"icon":12},"Introduction","docs\u002Findex","i-lucide-house",{"title":14,"icon":15,"path":16,"stem":17,"children":18,"page":15},"Getting Started",false,"\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",[19,24,29,34,51,56],{"title":20,"path":21,"stem":22,"icon":23},"Installation","\u002Fdocs\u002Fgetting-started\u002Finstallation","docs\u002F1.getting-started\u002F1.installation","i-lucide-download",{"title":25,"path":26,"stem":27,"icon":28},"Creating links","\u002Fdocs\u002Fgetting-started\u002Flinks","docs\u002F1.getting-started\u002F2.links","i-lucide-link",{"title":30,"path":31,"stem":32,"icon":33},"Testing","\u002Fdocs\u002Fgetting-started\u002Ftesting","docs\u002F1.getting-started\u002F3.testing","i-lucide-flask-conical",{"title":35,"path":36,"stem":37,"children":38,"icon":40},"iOS attribution","\u002Fdocs\u002Fgetting-started\u002Fios-attribution","docs\u002F1.getting-started\u002F4.ios-attribution\u002Findex",[39,41,46],{"title":35,"path":36,"stem":37,"icon":40},"i-lucide-smartphone",{"title":42,"path":43,"stem":44,"icon":45},"App Clips","\u002Fdocs\u002Fgetting-started\u002Fios-attribution\u002Fapp-clips","docs\u002F1.getting-started\u002F4.ios-attribution\u002F1.app-clips","i-lucide-app-window",{"title":47,"path":48,"stem":49,"icon":50},"Pasteboard","\u002Fdocs\u002Fgetting-started\u002Fios-attribution\u002Fpasteboard","docs\u002F1.getting-started\u002F4.ios-attribution\u002F2.pasteboard","i-lucide-clipboard-paste",{"title":52,"path":53,"stem":54,"icon":55},"Analytics, MAU & Plans","\u002Fdocs\u002Fgetting-started\u002Fanalytics","docs\u002F1.getting-started\u002F5.analytics","i-lucide-chart-line",{"title":57,"path":58,"stem":59,"icon":60},"Workspaces & Team Access","\u002Fdocs\u002Fgetting-started\u002Fworkspaces","docs\u002F1.getting-started\u002F6.workspaces","i-lucide-building-2",{"title":62,"icon":63,"path":64,"stem":65,"children":66,"page":15},"SDKs","i-lucide-package","\u002Fdocs\u002Fsdks","docs\u002F2.sdks",[67],{"title":68,"icon":69,"path":70,"stem":71,"children":72,"page":15},"Capacitor","i-simple-icons-capacitor","\u002Fdocs\u002Fsdks\u002Fcapacitor","docs\u002F2.sdks\u002F1.capacitor",[73,76],{"title":20,"path":74,"stem":75,"icon":23},"\u002Fdocs\u002Fsdks\u002Fcapacitor\u002Finstallation","docs\u002F2.sdks\u002F1.capacitor\u002F1.installation",{"title":77,"path":78,"stem":79,"icon":80},"API reference","\u002Fdocs\u002Fsdks\u002Fcapacitor\u002Fapi","docs\u002F2.sdks\u002F1.capacitor\u002F2.api","i-lucide-code",{"id":82,"title":30,"body":83,"description":490,"extension":491,"links":492,"meta":493,"navigation":494,"path":31,"seo":495,"stem":32,"__hash__":496},"docs\u002Fdocs\u002F1.getting-started\u002F3.testing.md",{"type":84,"value":85,"toc":482},"minimark",[86,95,100,158,161,167,171,186,189,292,302,311,315,335,338,342,353,373,389,393,400,404,416,453,460,478],[87,88,89,90,94],"p",{},"Every app has a ",[91,92,93],"strong",{},"test environment"," — an isolated view of installs, opens, and events that keeps QA traffic out of your live metrics. Use the Live \u002F Test switch on the app overview page in the dashboard.",[96,97,99],"h2",{"id":98},"what-is-environment-scoped","What is environment-scoped",[101,102,103,116],"table",{},[104,105,106],"thead",{},[107,108,109,113],"tr",{},[110,111,112],"th",{},"Data",[110,114,115],{},"Environment-scoped?",[117,118,119,136,144,151],"tbody",{},[107,120,121,125],{},[122,123,124],"td",{},"Installs, opens, events (incl. revenue)",[122,126,127,128,132,133],{},"Yes — tagged ",[129,130,131],"code",{},"live"," or ",[129,134,135],{},"test",[107,137,138,141],{},[122,139,140],{},"Links",[122,142,143],{},"No — shared",[107,145,146,149],{},[122,147,148],{},"Clicks",[122,150,143],{},[107,152,153,156],{},[122,154,155],{},"Devices",[122,157,143],{},[87,159,160],{},"Links, clicks, and devices are shared deliberately: testing should exercise the real pipeline. A test install still resolves your real links and matches real clicks — the only difference is that the recorded install lands in the test environment.",[162,163,164],"note",{},[87,165,166],{},"Because clicks are shared, a test install can match a live click — that's intended, it's what makes end-to-end attribution testing work. In the test view, the Clicks metric still shows all app clicks; only installs, opens, and events are filtered.",[96,168,170],{"id":169},"test-keys","Test keys",[87,172,173,174,177,178,181,182,185],{},"Test credentials are separate key pairs issued per app — create one in the dashboard under ",[91,175,176],{},"App → Settings → API keys → New test key",". Test credentials use self-identifying prefixes (",[129,179,180],{},"ak_test_…"," \u002F ",[129,183,184],{},"sk_test_…",").",[87,187,188],{},"Ship the test key in debug\u002Finternal builds and the live key in release builds:",[190,191,196],"pre",{"className":192,"code":193,"language":194,"meta":195,"style":195},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","await Attriv.init({\n  appKey: __DEV__ ? \"ak_test_…\" : \"ak_…\",\n  apiUrl: \"https:\u002F\u002Fapi.getattriv.com\",\n});\n","ts","",[129,197,198,225,263,280],{"__ignoreMap":195},[199,200,203,207,211,215,219,222],"span",{"class":201,"line":202},"line",1,[199,204,206],{"class":205},"s7zQu","await",[199,208,210],{"class":209},"sTEyZ"," Attriv",[199,212,214],{"class":213},"sMK4o",".",[199,216,218],{"class":217},"s2Zo4","init",[199,220,221],{"class":209},"(",[199,223,224],{"class":213},"{\n",[199,226,228,232,235,238,241,244,247,250,253,255,258,260],{"class":201,"line":227},2,[199,229,231],{"class":230},"swJcz","  appKey",[199,233,234],{"class":213},":",[199,236,237],{"class":209}," __DEV__ ",[199,239,240],{"class":213},"?",[199,242,243],{"class":213}," \"",[199,245,180],{"class":246},"sfazB",[199,248,249],{"class":213},"\"",[199,251,252],{"class":213}," :",[199,254,243],{"class":213},[199,256,257],{"class":246},"ak_…",[199,259,249],{"class":213},[199,261,262],{"class":213},",\n",[199,264,266,269,271,273,276,278],{"class":201,"line":265},3,[199,267,268],{"class":230},"  apiUrl",[199,270,234],{"class":213},[199,272,243],{"class":213},[199,274,275],{"class":246},"https:\u002F\u002Fapi.getattriv.com",[199,277,249],{"class":213},[199,279,262],{"class":213},[199,281,283,286,289],{"class":201,"line":282},4,[199,284,285],{"class":213},"}",[199,287,288],{"class":209},")",[199,290,291],{"class":213},";\n",[87,293,294,295,297,298,301],{},"Installs, opens, and custom events reported under a test key are tagged ",[129,296,135],{}," and appear only in the test view. SDK-facing behavior is identical — attribution, deep links, and ",[129,299,300],{},"getAttribution()"," work the same under either key.",[162,303,304],{},[87,305,306,307,310],{},"A test key can be freely rotated and shared with the dev team or CI. If it leaks, the worst case is test data pollution — live metrics are unaffected. Rotate by issuing a new pair, deploying it, then deleting the old one under ",[91,308,309],{},"App → Settings → API keys"," — deletion revokes the pair immediately. The list shows when each pair was created and last authenticated, so stale pairs are easy to spot.",[96,312,314],{"id":313},"testing-installs-and-attribution","Testing installs and attribution",[316,317,318,322,325],"ol",{},[319,320,321],"li",{},"Create a regular link in the dashboard (test views use live links).",[319,323,324],{},"Click it on a device with a debug build (using the test key) or paste it into a notes app.",[319,326,327,328,330,331,334],{},"Install\u002Fopen the app — the install records under ",[129,329,135],{}," and shows up in the test view with its ",[129,332,333],{},"matchType"," badge.",[87,336,337],{},"To test again on the same device, uninstall and reinstall the app — the reinstall path re-runs attribution just like production.",[96,339,341],{"id":340},"revenue-events-revenuecat","Revenue events (RevenueCat)",[87,343,344,345,348,349,352],{},"RevenueCat sandbox purchases are routed automatically: any event with ",[129,346,347],{},"environment: \"SANDBOX\""," is recorded in the test environment regardless of which key authenticated the webhook. Enable ",[91,350,351],{},"Sandbox webhooks"," in your RevenueCat project to have sandbox events delivered at all.",[354,355,356,359,370],"ul",{},[319,357,358],{},"Sandbox purchases (incl. accelerated sandbox renewals) land in the test view with their price — useful for verifying revenue attribution end to end.",[319,360,361,362,365,366,369],{},"RevenueCat ",[91,363,364],{},"TEST"," events (sent from the RevenueCat dashboard when configuring the webhook) are recorded as ",[129,367,368],{},"revenuecat.test"," — the quickest way to verify the delivery path.",[319,371,372],{},"Test-environment revenue is test money — it never counts toward live revenue.",[162,374,375],{},[87,376,377,378,380,381,384,385,388],{},"Attribution is last-touch within each environment: a sandbox purchase attributes to the buyer's most recent ",[91,379,135],{}," install. For revenue attribution to work in test, the purchase's ",[129,382,383],{},"app_user_id"," must match the identity your SDK reported via ",[129,386,387],{},"Attriv.identify()"," under the test key.",[96,390,392],{"id":391},"testflight","TestFlight",[87,394,395,396,399],{},"TestFlight purchases are sandbox transactions, so store webhooks report them in the sandbox environment. TestFlight builds typically embed the same release binary — if you also want TestFlight ",[91,397,398],{},"installs"," to stay out of live stats, ship the test key in that build.",[96,401,403],{"id":402},"stats-api","Stats API",[87,405,406,407,410,411,413,414,234],{},"All stats endpoints accept an ",[129,408,409],{},"env"," query parameter — ",[129,412,131],{}," (default) or ",[129,415,135],{},[190,417,422],{"className":418,"code":419,"filename":420,"language":421,"meta":195,"style":195},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl \"https:\u002F\u002Fapi.getattriv.com\u002Fapi\u002Fapps\u002F{appId}\u002Fstats\u002Foverview?env=test&days=30\" \\\n  -H \"Authorization: Bearer \u003Caccess_token>\"\n","Terminal","bash",[129,423,424,440],{"__ignoreMap":195},[199,425,426,430,432,435,437],{"class":201,"line":202},[199,427,429],{"class":428},"sBMFI","curl",[199,431,243],{"class":213},[199,433,434],{"class":246},"https:\u002F\u002Fapi.getattriv.com\u002Fapi\u002Fapps\u002F{appId}\u002Fstats\u002Foverview?env=test&days=30",[199,436,249],{"class":213},[199,438,439],{"class":209}," \\\n",[199,441,442,445,447,450],{"class":201,"line":227},[199,443,444],{"class":246},"  -H",[199,446,243],{"class":213},[199,448,449],{"class":246},"Authorization: Bearer \u003Caccess_token>",[199,451,452],{"class":213},"\"\n",[87,454,455,456,459],{},"If you belong to more than one workspace, also pass ",[129,457,458],{},"-H \"x-attriv-org: \u003Cworkspace_id>\""," so the app resolves in the right one — with a single workspace the header is optional.",[87,461,462,463,466,467,470,471,473,474,477],{},"Key creation accepts it too — ",[129,464,465],{},"POST \u002Fapi\u002Fapps\u002F{appId}\u002Fkeys?env=test"," issues a test key pair. ",[129,468,469],{},"DELETE \u002Fapi\u002Fapps\u002F{appId}\u002Fkeys\u002F{keyId}"," revokes a pair: SDK calls with its ",[129,472,257],{}," and webhook requests with its ",[129,475,476],{},"sk_…"," start failing immediately.",[479,480,481],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":195,"searchDepth":202,"depth":227,"links":483},[484,485,486,487,488,489],{"id":98,"depth":227,"text":99},{"id":169,"depth":227,"text":170},{"id":313,"depth":227,"text":314},{"id":340,"depth":227,"text":341},{"id":391,"depth":227,"text":392},{"id":402,"depth":227,"text":403},"Use the test environment to verify attribution and revenue events without polluting live stats.","md",null,{},{"icon":33},{"title":30,"description":490},"QD7FWVCTA4UTZdZuVDorTIINZQ9dbxLJrr0EPOBQEXU",[498,500],{"title":25,"path":26,"stem":27,"description":499,"icon":28,"children":-1},"Create deep and affiliate links on your custom link domains.",{"title":35,"path":36,"stem":37,"description":501,"icon":40,"children":-1},"The three iOS signals Attriv uses — App Clip, pasteboard, and fingerprint — and how to configure or disable each one.",1796354788261]