API reference for the MobileDeposit class. The core entry point for mobile SDK integrations.
The MobileDeposit class is the main entry point for the mobile SDK. It manages the signer call, in-app browser lifecycle, deep link handling, and completion detection.
import { MobileDeposit } from '@swype-org/deposit-mobile';
URL string for the signer endpoint, or a custom async function. When a string, the SDK sends a POST with a JSON SignerRequest body. When a function, the SDK calls it with a SignerRequest and expects a Promise<SignerResponse>.
callbackScheme
string
required
Custom URL scheme registered by the mobile app (e.g. 'myapp'). The hosted flow redirects to {callbackScheme}://swype/callback?... on completion.
openUrl
(url: string) => Promise<void>
required
Function that opens a URL in an in-app browser. Use expo-web-browser, SFSafariViewController (iOS), or CustomTabsIntent (Android). The returned promise should resolve when the browser is dismissed.
environment
'production' | 'sandbox'
'production'
Blink environment to target. 'sandbox' points the hosted flow at the testnet sandbox (https://pay-sandbox.blink.cash). An explicit webviewBaseUrl takes precedence.
webviewBaseUrl
string
'https://pay.blink.cash'
Base URL of the hosted payment webview app. Overrides environment when set.
callbackPath
string
'/swype/callback'
Path component of the callback deep link.
signerTimeoutMs
number
15000
Maximum milliseconds to wait for the signer to respond.
flowTimeoutMs
number
undefined (no limit)
Maximum milliseconds for the entire flow (signer + user completion).
Color scheme and deposit title visibility of the hosted UI. hideDepositTitle defaults to false; set it to true to hide deposit entry/status titles while keeping More and navigation titles. 'system' follows the device’s prefers-color-scheme as reported inside the in-app browser and flips live when it changes. There is no auto-detection on mobile — omitting this renders light. See Dark and light mode.
debug
boolean
false
Log lifecycle events to console.debug with the [SwypeMobileDeposit] prefix.
appearance is read when the instance builds the hosted-flow URL. To change the theme, call destroy() and construct a new MobileDeposit.
Opens the hosted deposit flow in an in-app browser. The returned Promise resolves when the user completes the payment (via deep link callback) and rejects with a DepositError on failure.The merchant must listen for incoming deep links and pass them to handleDeepLink() for the promise to resolve.If a flow is already active, calling requestDeposit again cancels the previous flow and starts a new one.Pass minimumDeposit in the request to raise the minimum deposit in USD. It never lowers Blink’s route minimum. See Minimum deposit for validation, and Types for the full DepositRequest and DepositResult definitions.
Feed an incoming deep link URL to the SDK. Returns true if the URL was a valid Blink callback and the SDK handled it, false if the URL did not match the expected callback pattern.Call this from your deep link listener (e.g. Linking.addEventListener('url', ...)).
Tear down the instance and release all resources. Clears all timers, removes all event listeners, and marks the instance as destroyed. Subsequent calls to requestDeposit will reject with INVALID_REQUEST.Call this on component unmount.