Onmeta Widget Integration
Widget Creation
SDK integration
3min
react native sdk 🛠️ react native apps can make use of our sdk and integrate their apps with onmeta seamlessly as below npm package can be installed from here https //www npmjs com/package/@onmeta/react native sdk https //www npmjs com/package/@onmeta/react native sdk make sure you install the required dependency packages without fail follow the steps given below and integrate the on/offramp widget within your app, below is the sample integration import metawidget from "@onmeta/react native sdk"; const eventhandler = async (event, data) => { switch (event) { // example to open the upi apps case "upi intent" { const linkdata = await json parse(data); void linking openurl(linkdata link); } default { // default code } } }; \<metawidget queryparams={{ apikey " merchant api key ", environment "staging/production", }} oneventhandler={eventhandler} />; you can use the same config parameters mentioned in widget creation page to customize your widget events will be received are as below eventname description order created order created event (success, failed, pending) order status order status change event order event kyc redirect related event with redirect url utr capture utr captured event upi intent upi intent event which gives the upi deeplinks to open upi apps text copy text copy event to copy any text details like, bank details or upi id sample event body will be as below order created { "channelname" "onmeta channel 1699364767487 62481317", "eventname" "order created", "data" { "eventcategory" "order", "paymentstatus" "pending", "cryptoswap" "pending", "orderid" "654a3fc8c252b81cd384681e", "eventtype" "ordercreated", "paymenttype" "buy" }, "userid" null } upi intent { "channelname" "onmeta channel 1699365314488 28596314", "eventname" "upi intent", "data" { "type" "upi fast", "link" "phonepe //pay?pa=merchant452915 augp\@aubank\&pn=abhibha\&am=100 00\&cu=inr\&tn=654a4219ccd3846846", "name" "phonepe" }, "userid" null } text copy { "channelname" "onmeta channel 1699365860958 40579766", "eventname" "text copy", "data" { "detail" { "text" "0991898392323" } }, "userid" null } utr capture { "channelname" "onmeta channel 1699365860958 40579766", "eventname" "utr capture", "data" { "eventcategory" "order", "paymentstatus" "utrcaptured", "cryptoswap" "pending", "orderid" "654a43f8c252b81cd3846856", "paymenttype" "buy" }, "userid" null } order status { "channelname" "onmeta channel 1699365860958 40579766", "eventname" "order status", "data" { "detail" { "eventcategory" "order", "paymentstatus" "pending", "cryptoswap" "success", "paymenttype" "sell", } } }{ "channelname" "onmeta channel 1699365860958 40579766", "eventname" "order event", "data" { "detail" { "type" "kyc redirect", "link" "https //xyz com" } } }