The Super App API creates a communication interface in the Super App to allow Mini Apps hosted by it to interact. This is done without the need to implement the functionalities provided in the API separately for each Mini App, thus enhancing security.
GeneXus' Super App API offers an efficient way to achieve integration between the Super Apps and Mini Apps. This interface acts as a bridge for Mini Apps to communicate with, and send data to, the Super App. You will also define methods, parameters, and data structures within the Super App, in addition to using the Super App Source section to expose services that Mini Apps can access.
With the setup of this interface, Mini Apps can efficiently communicate with the host Super App, enabling integration and data exchange. Mini Apps can access specific functionality and data provided by the Super App through the exposed API, ensuring a cohesive user experience.
The following refers to the sample started in HowTo: Create a Super App, which considers the Verdant Bank Super App Sample that emulates a wallet.
Mini Apps are activated from this Super App to facilitate the purchase of various products or services. During the payment process, each Mini App invokes the Super App through the defined API to complete the payment in the Super App, where the user has already registered various payment methods.
In the Super App Knowledge Base, there is a Panel object named PaymentPanel that presents the user's different payment methods. Once a payment method is selected, the corresponding payment is processed.
To expose this Panel via API for invocation from Mini Apps, add the following code to the Super App Source section:
Payment {
NewPayment(in:&ExternalReference, in:&Amount, out:&Success, out:&PaymentId)
=> PaymentPanel(&ExternalReference, &Amount, &Success, &PaymentId);
}
For more details, see Super App Source and its considerations.
To ensure that Mini Apps can access this interface developed in different Knowledge Bases, export them as a package module.
1) Right-click on SampleVerdantBankApi module.
2) Select Package Module…
3) The following window will appear to configure:
Complete all the necessary fields and click on the Package & Publish button.
If you have an application (that is not developed with GeneXus) converted into a Super App using GeneXus technology, follow the examples of the following non-GeneXus Super Apps to create a Super App API:
Follow these samples according to the type of Mini App: