iome logo
Documentation
IOMe Widget
The IOMe widget offers an extensive collection of UI components and specialized modules for developers, applications, and users. Additionally, the Utils module provides a wide range of utility functions, including a wallet library, encoding and cryptography tools etc. This comprehensive approach guarantees that IOMe effectively addresses the diverse requirements of your web or mobile application.
Prerequistics
  • Explore the App Secret section to learn more about the App Secret.
  • Once you copied App Secret, keep it confidential.
  • And import it into your application from environment file.
Installation
IOMe Widget is currently tailored to support web applications, with an exciting roadmap ahead. We are diligently working towards expanding its reach to encompass mobile application development as well, fostering a consistent and efficient development experience across both web and mobile environments. Our upcoming releases will introduce dedicated widgets or modules crafted specifically for platforms like React Native and Flutter.
npm install @iome/react-widget --save
Usage
  • Developer module
    iome.InitDev(), Initializes the developer module to ensure the given developer ID is eligible to use the widget.
    
                import { IOMe } from "@iome/react-widget";
    
                let iome = new IOMe("<developerID>");
                await iome.InitDev();
                console.log(iome.devID);
                                
  • Application module
    iome.InitApp(), Initializes the application module to ensure the given 'AppSecret' is valid and corresponds to Developer.
    
                import { IOMe } from "@iome/react-widget";
    
                let iome = new IOMe("<developerID>", "<appSecret>");
                await iome.InitDev();
                await iome.InitApp();
                console.log(iome.app.appID);
                                
    Following are the functions that can be accessed through app module
    • iome.app.GetAuthToken(type, message, appSecret?), to fetch the authentication token of the app to access/read certain app specific APIs. Learn about the "type" paramater under DAT Components section in this page.
    • iome.app.OnboardingCriteria(), to fetch onboarding rules to join the application.
    • iome.app.DataPermissions(), to fetch all the data permissions that user are consenting to the application.
    • iome.app.Meta(), to fetch meta-data about the application
    • iome.app.EncodedAppName, to derive the encoded string of the appname.
    • iome.app.IgcPathArray, to derive the IGC path of the application
  • User module
    User module can only be initialized through Login UI component from iome-widget
    
                import { IOMe, Connect } from "@iome/react-widget";
    
                let iome = new IOMe("<developerID>", "<appSecret>");
                await iome.InitDev();
                await iome.InitApp();
    
                <Connect
                    onSuccess={handleSuccess}
                    iome={iome}
                />
                                
  • Utils
    Utils module will be used for various utilities like wallet, encoding, crypto etc functionalities.
    
                import { Utils } from "@iome/react-widget";
    
                new Utils.HdWallet()
                Utils.zk.Generate("credential", version)
                Utils.enc.mEncode("string")
                Utils.enc.mDecode("encoded_string")