Install and import
Install @bdk/native and pick the right import for browser or server code.
Install the package
Add @bdk/native with your package manager. Server code needs Node.js 18 or newer.
Import for app code
Import from @bdk/native for a single, obvious import path in app code. Use createBdkNative() to create a ready-to-use client.
The root and /browser entries resolve to the same module. Pick whichever import path reads best.
Import in the WebView
Use @bdk/native/browser for code that runs inside the WebView or a browser. It exports createBdkNative, BdkNativeClient, NativeBridge, the error helpers, and the browser types (BdkNativeConfig, NavigateOptions, LoadingScreenOptions, OpenLinkOptions, UrlParam, PermissionName).
Pass a BdkNativeConfig to tune behavior — common fields are removeLoading ("automatic" or "manual"), pageFit, autoRequestDeviceInfo, and an onError callback that receives a BdkError. Browser method options are passed straight through to the native command — match the key names it expects.
Awaiting a browser namespace method resolves when the call is sent, not when the native action finishes. For real resolved results, use the server helpers below.
Import on the server
Use the @bdk/native/server entries for Node code — push notifications, receipt validation, deep links. These helpers are fully typed and return real resolved results.
Import the aggregate @bdk/native/server, or a single concern to keep your bundle lean:
@bdk/native/server/onesignal— push notifications (e.g.sendPushNotification)@bdk/native/server/iap— receipt validation (e.g.verifyIosReceipt,verifyAndroidReceipt,consumeAndroidPurchase)@bdk/native/server/branch— Branch deep links@bdk/native/server/chottulink— ChottuLink deep links@bdk/native/server/firebase-dynamic-links— Firebase Dynamic Links
Never import a @bdk/native/server/* module into browser code — it pulls in Node-only dependencies and breaks the build.
Use without a bundler (CDN)
Drop in the prebuilt IIFE bundle to use the SDK without a bundler. It is published to unpkg and jsdelivr and attaches a BdkNative global to window, so createBdkNative is available as BdkNative.createBdkNative. Server helpers are not included.
Browser-safe vs server-only
The root, /browser, and the CDN global build are browser-safe. Every /server entry and subpath is server-only.
The single rule that prevents most build failures: never import @bdk/native/server/* into anything that ships to the browser.