npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@iome/react-widget

v0.1.4

Published

A widget that is compatible with NextJS and ReactJS development, serving as a bridge connecting IOMe users to digital(web3 and web2) applications.

Downloads

34

Readme

IOMe Widget

npm version Chat on Slack docs Follow us on Twitter

Overview

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.

Moreover, this npm package is specifically crafted to seamlessly integrate with both ReactJS and NextJS frontend frameworks.

Installation

npm install @iome/react-widget

Pre-requisites

Before you begin, ensure you have your DeveloperID and AppSecret ready. You can find instructions on how to obtain them by visiting this link.

Usage

// Import
import { IOMe, Connect, Utils } from "@iome/react-widget"
let iomeObj = new IOMe("<developerID>","<AppSecret>");

// Init
useEffect(() => {
	async function __initIome() {
		try {
			await iomeObj.InitDev();
			await iomeObj.InitApp();
		}catch(e) {
			// handle error
		}
	}
	__initIOMe();
},[])

Connect Widget

<Connect
	onSuccess={// handle success event}
	iome={iomeObj}
/>

This Connect component is responsible for managing both current users of the applications and onboarding of new users.

App and user modules

  • App To initialize the App module, simply use the following code:

    const iome = new IOMe(DeveloperID, AppSecret)
    iome.InitDev()
    iome.InitApp()

    To learn more about the functions under the app module. Visit this page.

  • User To initialize the User module, you must connect the widget to your application as detailed in the Connect Widget section.

    Once a user logs in using their IOMe credentials, the User module will be automatically initialized. This allows you to access any function under it. For instance, to generate a user session token, you can make the following call:

    Fetch user MOI ID aka Participant ID

    iome.user.ParticipantID

    Generate User Auth Token

    // iome.user.getAuthToken(DAT Token Type, message)
    iome.user.getAuthToken("SESSION", <timestamp>)

    Sign a message

    const signatureDetails = iome.user.sign("message to be signed");
    console.log(signatureDetails)
    /*
    {
      message: "i'm getting signed",
      pubKey: '0x0399d76e4747439fe43e76b2d174ef2f40d81f3f31bb7ccb66e01c5d612a8777f1',
      shortenAddress: '0x8150C9cba21AdbFd8DEe5102f8311ad5B037AF6e',
      signature: {
        algorithm: 'ecdsa_secp256k1',
        digest: '0xe552649e81c3036372b305e91c5f87cbbb447aa5d9b624027d0afce7fb50fe662f98ecfa8e606fd01b8554510f84df2fa22d477d3f7283054b8e9c3fa9b125761c'
      }
    }
    */

Please ensure that the user has successfully logged in before using above functions.

Utils module

enc The Utils.enc class is created with the intent of simplifying the encoding and decoding of both general strings like Usernames and Attribute names, as well as specific IOMe namespaces like App names, Account names and Avatar names.

  • Utils.enc.mEncode(<string>)
  • Utils.enc.mDecode(<encodedstring>, <isNamespace>), pass isNamespace=true if encoded string is IOMe namespace.

zk The Utils.zk class is intended to assist in the generation and verification of Zero-Knowledge Proofs (ZK Proofs) that are created during interactions in IOMe.

Support

If you need more clarifications, feel free to join our Slack community. You can also refer to our Widget docs.

License

This project is licensed under either of

at your option.

The SPDX license identifier for this project is MIT or Apache-2.0.