[{"data":1,"prerenderedAt":868},["ShallowReactive",2],{"navigation_docs":3,"-getting-started-introduction":137,"-getting-started-introduction-surround":865},[4,27,57,79,97,115],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":26},"Getting Started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,14,18,22],{"title":11,"path":12,"stem":13},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":19,"path":20,"stem":21},"Quick start","\u002Fgetting-started\u002Fquick-start","1.getting-started\u002F3.quick-start",{"title":23,"path":24,"stem":25},"Architecture","\u002Fgetting-started\u002Farchitecture","1.getting-started\u002F4.architecture",false,{"title":28,"icon":29,"path":30,"stem":31,"children":32,"page":26},"Mini Apps","i-lucide-smartphone","\u002Fmini-apps","2.mini-apps",[33,37,41,45,49,53],{"title":34,"path":35,"stem":36},"Provider runtime","\u002Fmini-apps\u002Fprovider-runtime","2.mini-apps\u002F1.provider-runtime",{"title":38,"path":39,"stem":40},"Ethereum provider","\u002Fmini-apps\u002Fethereum-provider","2.mini-apps\u002F2.ethereum-provider",{"title":42,"path":43,"stem":44},"Language and i18n","\u002Fmini-apps\u002Flanguage-i18n","2.mini-apps\u002F3.language-i18n",{"title":46,"path":47,"stem":48},"Local simulator","\u002Fmini-apps\u002Flocal-simulator","2.mini-apps\u002F4.local-simulator",{"title":50,"path":51,"stem":52},"Nuxt module","\u002Fmini-apps\u002Fnuxt-module","2.mini-apps\u002F5.nuxt-module",{"title":54,"path":55,"stem":56},"Host runtime","\u002Fmini-apps\u002Fhost-runtime","2.mini-apps\u002F6.host-runtime",{"title":58,"icon":59,"path":60,"stem":61,"children":62,"page":26},"Auth","i-lucide-key-round","\u002Fauth","3.auth",[63,67,71,75],{"title":64,"path":65,"stem":66},"Nimiq Better Auth","\u002Fauth\u002Fnimiq-better-auth","3.auth\u002F1.nimiq-better-auth",{"title":68,"path":69,"stem":70},"Cross-device approval","\u002Fauth\u002Fcross-device","3.auth\u002F2.cross-device",{"title":72,"path":73,"stem":74},"Nimiq cross-device adapter","\u002Fauth\u002Fnimiq-adapter","3.auth\u002F3.nimiq-adapter",{"title":76,"path":77,"stem":78},"Security model","\u002Fauth\u002Fsecurity-model","3.auth\u002F4.security-model",{"title":80,"icon":81,"path":82,"stem":83,"children":84,"page":26},"Utilities","i-lucide-wrench","\u002Futilities","4.utilities",[85,89,93],{"title":86,"path":87,"stem":88},"Universal Nimiq facade","\u002Futilities\u002Funimiq","4.utilities\u002F1.unimiq",{"title":90,"path":91,"stem":92},"ERC-20 helpers","\u002Futilities\u002Funerc20","4.utilities\u002F2.unerc20",{"title":94,"path":95,"stem":96},"Better Auth ledger","\u002Futilities\u002Fledger","4.utilities\u002F3.ledger",{"title":98,"icon":99,"path":100,"stem":101,"children":102,"page":26},"Testing","i-lucide-test-tube-2","\u002Ftesting","5.testing",[103,107,111],{"title":104,"path":105,"stem":106},"Local scenarios","\u002Ftesting\u002Flocal-scenarios","5.testing\u002F1.local-scenarios",{"title":108,"path":109,"stem":110},"Vitest helpers","\u002Ftesting\u002Fvitest-helpers","5.testing\u002F2.vitest-helpers",{"title":112,"path":113,"stem":114},"Bridge mode","\u002Ftesting\u002Fbridge-mode","5.testing\u002F3.bridge-mode",{"title":116,"icon":117,"path":118,"stem":119,"children":120,"page":26},"Reference","i-lucide-book-open","\u002Freference","6.reference",[121,125,129,133],{"title":122,"path":123,"stem":124},"Packages","\u002Freference\u002Fpackages","6.reference\u002F1.packages",{"title":126,"path":127,"stem":128},"Endpoints","\u002Freference\u002Fendpoints","6.reference\u002F2.endpoints",{"title":130,"path":131,"stem":132},"Runtime support","\u002Freference\u002Fruntime-support","6.reference\u002F3.runtime-support",{"title":134,"path":135,"stem":136},"Public API exports","\u002Freference\u002Fpublic-api","6.reference\u002F4.public-api",{"id":138,"title":11,"body":139,"description":859,"extension":860,"links":861,"meta":862,"navigation":356,"path":12,"seo":863,"stem":13,"__hash__":864},"docs\u002F1.getting-started\u002F1.introduction.md",{"type":140,"value":141,"toc":852},"minimark",[142,146,149,152,157,296,300,303,432,435,441,445,451,648,651,655,658,835,838,842,845,848],[143,144,145],"p",{},"Use Onmax Mini Apps SDK when your app runs inside Nimiq Pay, needs the injected Nimiq or Ethereum provider, or asks a Nimiq wallet to approve a Better Auth flow.",[143,147,148],{},"The SDK solves the integration work around the wallet, not the product logic around your app. It gives you typed provider access in the mini-app browser, Better Auth plugins for Nimiq-owned sessions, cross-device order primitives for desktop-to-phone approval, and local test helpers for the same flows. New apps can wire one layer at a time instead of mixing host detection, signature verification, session ownership, and simulator code in the same module.",[143,150,151],{},"The packages are small on purpose. Start with the package that owns your first decision, then add integrations only when the flow needs them.",[153,154,156],"h2",{"id":155},"start-with-one-job","Start with one job",[158,159,160,176],"table",{},[161,162,163],"thead",{},[164,165,166,170,173],"tr",{},[167,168,169],"th",{},"You need to",[167,171,172],{},"Install first",[167,174,175],{},"Then add",[177,178,179,205,220,236,256,270,283],"tbody",{},[164,180,181,194,199],{},[182,183,184,185,189,190,193],"td",{},"Read ",[186,187,188],"code",{},"window.nimiq",", ",[186,191,192],{},"window.ethereum",", host language, or simulator providers",[182,195,196],{},[186,197,198],{},"@onmax\u002Fnimiq-mini-app-kit",[182,200,201,204],{},[186,202,203],{},"@onmax\u002Funerc20"," for ERC-20 calls",[164,206,207,210,215],{},[182,208,209],{},"Create a Better Auth session from the current Nimiq wallet",[182,211,212],{},[186,213,214],{},"@onmax\u002Fbetter-auth-nimiq",[182,216,217,219],{},[186,218,198],{}," for provider detection",[164,221,222,225,230],{},[182,223,224],{},"Start a desktop order that a phone approves",[182,226,227],{},[186,228,229],{},"@onmax\u002Fbetter-auth-cross-device",[182,231,232,235],{},[186,233,234],{},"@onmax\u002Fcross-device-nimiq"," for Nimiq proofs",[164,237,238,241,246],{},[182,239,240],{},"Read balances, send NIM, format addresses, or test with a mock Nimiq driver",[182,242,243],{},[186,244,245],{},"@onmax\u002Funimiq",[182,247,248,251,252,255],{},[186,249,250],{},"@onmax\u002Funimiq\u002Fnuxt"," or ",[186,253,254],{},"@onmax\u002Funimiq\u002Fvite"," when using those frameworks",[164,257,258,261,265],{},[182,259,260],{},"Read ERC-20 metadata, balances, and transfers through an EIP-1193 provider",[182,262,263],{},[186,264,203],{},[182,266,267,269],{},[186,268,198],{}," when the provider comes from Nimiq Pay",[164,271,272,275,280],{},[182,273,274],{},"Store credits, points, gems, or app-local balances on Better Auth users",[182,276,277],{},[186,278,279],{},"@onmax\u002Fbetter-auth-ledger",[182,281,282],{},"Your own payment\u002Fcompliance flow for real-money top-ups",[164,284,285,288,293],{},[182,286,287],{},"Run deterministic auth scenarios in Vitest",[182,289,290],{},[186,291,292],{},"@onmax\u002Fbetter-auth-nimiq-pay-e2e",[182,294,295],{},"Bridge mode only when a real injected provider is available",[153,297,299],{"id":298},"use-the-mini-app-kit-when","Use the mini-app kit when",[143,301,302],{},"You are writing browser code that expects host-published provider surfaces.",[304,305,311],"pre",{"className":306,"code":307,"filename":308,"language":309,"meta":310,"style":310},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { initMiniAppEthereumProvider, initMiniAppProvider } from '@onmax\u002Fnimiq-mini-app-kit'\n\nexport const nimiq = await initMiniAppProvider({ timeout: 10_000 })\nexport const ethereum = await initMiniAppEthereumProvider({ timeout: 10_000 })\n","app\u002Fproviders.ts","ts","",[186,312,313,351,358,402],{"__ignoreMap":310},[314,315,318,322,326,330,333,336,339,342,345,348],"span",{"class":316,"line":317},"line",1,[314,319,321],{"class":320},"s7zQu","import",[314,323,325],{"class":324},"sMK4o"," {",[314,327,329],{"class":328},"sTEyZ"," initMiniAppEthereumProvider",[314,331,332],{"class":324},",",[314,334,335],{"class":328}," initMiniAppProvider",[314,337,338],{"class":324}," }",[314,340,341],{"class":320}," from",[314,343,344],{"class":324}," '",[314,346,198],{"class":347},"sfazB",[314,349,350],{"class":324},"'\n",[314,352,354],{"class":316,"line":353},2,[314,355,357],{"emptyLinePlaceholder":356},true,"\n",[314,359,361,364,368,371,374,377,380,383,386,390,393,397,399],{"class":316,"line":360},3,[314,362,363],{"class":320},"export",[314,365,367],{"class":366},"spNyl"," const",[314,369,370],{"class":328}," nimiq ",[314,372,373],{"class":324},"=",[314,375,376],{"class":320}," await",[314,378,335],{"class":379},"s2Zo4",[314,381,382],{"class":328},"(",[314,384,385],{"class":324},"{",[314,387,389],{"class":388},"swJcz"," timeout",[314,391,392],{"class":324},":",[314,394,396],{"class":395},"sbssI"," 10_000",[314,398,338],{"class":324},[314,400,401],{"class":328},")\n",[314,403,405,407,409,412,414,416,418,420,422,424,426,428,430],{"class":316,"line":404},4,[314,406,363],{"class":320},[314,408,367],{"class":366},[314,410,411],{"class":328}," ethereum ",[314,413,373],{"class":324},[314,415,376],{"class":320},[314,417,329],{"class":379},[314,419,382],{"class":328},[314,421,385],{"class":324},[314,423,389],{"class":388},[314,425,392],{"class":324},[314,427,396],{"class":395},[314,429,338],{"class":324},[314,431,401],{"class":328},[143,433,434],{},"Expected behavior: inside Nimiq Pay, both promises resolve to injected providers. Outside the host, they time out with a message that tells the user to open the app inside Nimiq Pay.",[143,436,437,438,440],{},"Do not use these provider waits in server code. Use ",[186,439,245],{}," with an RPC URL for server-side Nimiq reads.",[153,442,444],{"id":443},"use-direct-auth-when","Use direct auth when",[143,446,447,448,450],{},"The same browser that starts the flow can ask ",[186,449,188],{}," to sign the login challenge.",[304,452,455],{"className":306,"code":453,"filename":454,"language":309,"meta":310,"style":310},"import { betterAuth } from 'better-auth'\nimport { bearer } from 'better-auth\u002Fplugins'\nimport { nimiqAuth } from '@onmax\u002Fbetter-auth-nimiq'\n\nexport const auth = betterAuth({\n  plugins: [\n    bearer({ requireSignature: true }),\n    nimiqAuth({\n      appName: 'Arcade Rewards',\n      endpointPrefix: '\u002Fnimiq',\n    }),\n  ],\n})\n","server\u002Fauth.ts",[186,456,457,477,497,516,520,539,550,577,587,605,622,632,640],{"__ignoreMap":310},[314,458,459,461,463,466,468,470,472,475],{"class":316,"line":317},[314,460,321],{"class":320},[314,462,325],{"class":324},[314,464,465],{"class":328}," betterAuth",[314,467,338],{"class":324},[314,469,341],{"class":320},[314,471,344],{"class":324},[314,473,474],{"class":347},"better-auth",[314,476,350],{"class":324},[314,478,479,481,483,486,488,490,492,495],{"class":316,"line":353},[314,480,321],{"class":320},[314,482,325],{"class":324},[314,484,485],{"class":328}," bearer",[314,487,338],{"class":324},[314,489,341],{"class":320},[314,491,344],{"class":324},[314,493,494],{"class":347},"better-auth\u002Fplugins",[314,496,350],{"class":324},[314,498,499,501,503,506,508,510,512,514],{"class":316,"line":360},[314,500,321],{"class":320},[314,502,325],{"class":324},[314,504,505],{"class":328}," nimiqAuth",[314,507,338],{"class":324},[314,509,341],{"class":320},[314,511,344],{"class":324},[314,513,214],{"class":347},[314,515,350],{"class":324},[314,517,518],{"class":316,"line":404},[314,519,357],{"emptyLinePlaceholder":356},[314,521,523,525,527,530,532,534,536],{"class":316,"line":522},5,[314,524,363],{"class":320},[314,526,367],{"class":366},[314,528,529],{"class":328}," auth ",[314,531,373],{"class":324},[314,533,465],{"class":379},[314,535,382],{"class":328},[314,537,538],{"class":324},"{\n",[314,540,542,545,547],{"class":316,"line":541},6,[314,543,544],{"class":388},"  plugins",[314,546,392],{"class":324},[314,548,549],{"class":328}," [\n",[314,551,553,556,558,560,563,565,569,571,574],{"class":316,"line":552},7,[314,554,555],{"class":379},"    bearer",[314,557,382],{"class":328},[314,559,385],{"class":324},[314,561,562],{"class":388}," requireSignature",[314,564,392],{"class":324},[314,566,568],{"class":567},"sfNiH"," true",[314,570,338],{"class":324},[314,572,573],{"class":328},")",[314,575,576],{"class":324},",\n",[314,578,580,583,585],{"class":316,"line":579},8,[314,581,582],{"class":379},"    nimiqAuth",[314,584,382],{"class":328},[314,586,538],{"class":324},[314,588,590,593,595,597,600,603],{"class":316,"line":589},9,[314,591,592],{"class":388},"      appName",[314,594,392],{"class":324},[314,596,344],{"class":324},[314,598,599],{"class":347},"Arcade Rewards",[314,601,602],{"class":324},"'",[314,604,576],{"class":324},[314,606,608,611,613,615,618,620],{"class":316,"line":607},10,[314,609,610],{"class":388},"      endpointPrefix",[314,612,392],{"class":324},[314,614,344],{"class":324},[314,616,617],{"class":347},"\u002Fnimiq",[314,619,602],{"class":324},[314,621,576],{"class":324},[314,623,625,628,630],{"class":316,"line":624},11,[314,626,627],{"class":324},"    }",[314,629,573],{"class":328},[314,631,576],{"class":324},[314,633,635,638],{"class":316,"line":634},12,[314,636,637],{"class":328},"  ]",[314,639,576],{"class":324},[314,641,643,646],{"class":316,"line":642},13,[314,644,645],{"class":324},"}",[314,647,401],{"class":328},[143,649,650],{},"Do not use direct auth for a desktop-to-phone QR flow. Use cross-device orders so the desktop owns the session and the phone only approves the proof.",[153,652,654],{"id":653},"use-cross-device-auth-when","Use cross-device auth when",[143,656,657],{},"A desktop browser starts the order, and the Nimiq Pay phone app approves it.",[304,659,661],{"className":306,"code":660,"filename":454,"language":309,"meta":310,"style":310},"import { betterAuth } from 'better-auth'\nimport { crossDevice } from '@onmax\u002Fbetter-auth-cross-device'\nimport { createNimiqCrossDeviceAdapter } from '@onmax\u002Fcross-device-nimiq\u002Fserver'\n\nexport const auth = betterAuth({\n  plugins: [\n    crossDevice({\n      endpointPrefix: '\u002Fcross-device',\n      adapters: [\n        createNimiqCrossDeviceAdapter({ appName: 'Arcade Rewards' }),\n      ],\n    }),\n  ],\n})\n",[186,662,663,681,700,720,724,740,748,757,772,781,807,814,822,828],{"__ignoreMap":310},[314,664,665,667,669,671,673,675,677,679],{"class":316,"line":317},[314,666,321],{"class":320},[314,668,325],{"class":324},[314,670,465],{"class":328},[314,672,338],{"class":324},[314,674,341],{"class":320},[314,676,344],{"class":324},[314,678,474],{"class":347},[314,680,350],{"class":324},[314,682,683,685,687,690,692,694,696,698],{"class":316,"line":353},[314,684,321],{"class":320},[314,686,325],{"class":324},[314,688,689],{"class":328}," crossDevice",[314,691,338],{"class":324},[314,693,341],{"class":320},[314,695,344],{"class":324},[314,697,229],{"class":347},[314,699,350],{"class":324},[314,701,702,704,706,709,711,713,715,718],{"class":316,"line":360},[314,703,321],{"class":320},[314,705,325],{"class":324},[314,707,708],{"class":328}," createNimiqCrossDeviceAdapter",[314,710,338],{"class":324},[314,712,341],{"class":320},[314,714,344],{"class":324},[314,716,717],{"class":347},"@onmax\u002Fcross-device-nimiq\u002Fserver",[314,719,350],{"class":324},[314,721,722],{"class":316,"line":404},[314,723,357],{"emptyLinePlaceholder":356},[314,725,726,728,730,732,734,736,738],{"class":316,"line":522},[314,727,363],{"class":320},[314,729,367],{"class":366},[314,731,529],{"class":328},[314,733,373],{"class":324},[314,735,465],{"class":379},[314,737,382],{"class":328},[314,739,538],{"class":324},[314,741,742,744,746],{"class":316,"line":541},[314,743,544],{"class":388},[314,745,392],{"class":324},[314,747,549],{"class":328},[314,749,750,753,755],{"class":316,"line":552},[314,751,752],{"class":379},"    crossDevice",[314,754,382],{"class":328},[314,756,538],{"class":324},[314,758,759,761,763,765,768,770],{"class":316,"line":579},[314,760,610],{"class":388},[314,762,392],{"class":324},[314,764,344],{"class":324},[314,766,767],{"class":347},"\u002Fcross-device",[314,769,602],{"class":324},[314,771,576],{"class":324},[314,773,774,777,779],{"class":316,"line":589},[314,775,776],{"class":388},"      adapters",[314,778,392],{"class":324},[314,780,549],{"class":328},[314,782,783,786,788,790,793,795,797,799,801,803,805],{"class":316,"line":607},[314,784,785],{"class":379},"        createNimiqCrossDeviceAdapter",[314,787,382],{"class":328},[314,789,385],{"class":324},[314,791,792],{"class":388}," appName",[314,794,392],{"class":324},[314,796,344],{"class":324},[314,798,599],{"class":347},[314,800,602],{"class":324},[314,802,338],{"class":324},[314,804,573],{"class":328},[314,806,576],{"class":324},[314,808,809,812],{"class":316,"line":624},[314,810,811],{"class":328},"      ]",[314,813,576],{"class":324},[314,815,816,818,820],{"class":316,"line":634},[314,817,627],{"class":324},[314,819,573],{"class":328},[314,821,576],{"class":324},[314,823,824,826],{"class":316,"line":642},[314,825,637],{"class":328},[314,827,576],{"class":324},[314,829,831,833],{"class":316,"line":830},14,[314,832,645],{"class":324},[314,834,401],{"class":328},[143,836,837],{},"Expected behavior: the desktop receives the Better Auth session after finalization. The phone does not become signed in just because it approved the order.",[153,839,841],{"id":840},"what-this-sdk-does-not-do","What this SDK does not do",[143,843,844],{},"It does not recover wallets, custody funds, settle fiat payments, or replace product-level payment policy.",[143,846,847],{},"It also does not make app-local ledger balances equivalent to regulated stored value. Treat top-up, refund, withdrawal, and compliance decisions as application code.",[849,850,851],"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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":310,"searchDepth":353,"depth":353,"links":853},[854,855,856,857,858],{"id":155,"depth":353,"text":156},{"id":298,"depth":353,"text":299},{"id":443,"depth":353,"text":444},{"id":653,"depth":353,"text":654},{"id":840,"depth":353,"text":841},"Pick the first Onmax Mini Apps SDK package for your app flow.","md",null,{},{"title":11,"description":859},"K9UIb1QpbNMJ78pUe8pWubeOS6D73uCCSryve8uyRdg",[861,866],{"title":15,"path":16,"stem":17,"description":867,"children":-1},"Install the smallest package set for the flow you are building.",1778838253899]