@nevios/mobile-js
v0.1.0
Published
Native Nevios commerce client: secure sessions, verified links and resumable payments.
Readme
@nevios/mobile-js
Native adapter for Nevios commerce. Shares @nevios/storefront-js API with web
stores; adds secure async startup, device-bound email login and resumable payments.
pnpm add @nevios/mobile-js @nevios/storefront-js
npx expo install expo-secure-store expo-crypto expo-web-browserimport {createExpoStorefrontClient} from '@nevios/mobile-js/expo';
const nevios = await createExpoStorefrontClient({
publishableKey: 'pk_test_...', market: 'cz',
storageNamespace: 'merchant.app.test',
});
await nevios.account.requestMagicLink('[email protected]');
await nevios.mobile.handleUrl(urlFromOS);
await nevios.cart.addLine({variant_id: 'STRING_ID', quantity: 1});Register a native storefront key/channel and HTTPS app links first. The adapter
loads /storefront/2026-01/mobile.json at startup. The root entry exports
createMobileStorefrontClient with injectable secure-store/crypto/browser bridges
for non-Expo React Native apps and deterministic tests.
Customer/cart/checkout tokens never belong in AsyncStorage or analytics. Await
initialization before showing authenticated screens. Async stateful API calls wait
for secure storage; direct legacy synchronous storage/clear calls need
mobile.flush(). Prefer mobile.clearCartAndCheckout().
mobile.pay(paymentToken) persists the capability before starting a gateway and
opens the system browser. mobile.resumePayment() only reads authoritative state;
call on foreground/cold start. It never automatically restarts ambiguous attempts.
mobile.lastOrder() restores the last checkout order, including guest orders.
A browser return or ?status=PAID is never proof of payment. For explicit retries,
reconcile first, then let the user choose forgetPayment() and a new pay().
Integration guide and example in the Nevios repository:
docs/mobile-storefronts.md, examples/mobile-storefront/README.md.
Native wallet SDKs, push and offline mutation replay are outside this adapter.
