Get Started

circle-exclamation

Description

The Metafi JS SDK offers you the option to completely white-label and customise the UI of the wallet experience for your users. Please refer to the steps below to begin integration , and additionally, please post any other questions on our Discordarrow-up-right channel.

To view a sample integration, please refer to our demo applicationarrow-up-right.

Step 1: Install the library

First, install the library via your terminal.

# install via Yarn
yarn add @metafi/metafi-js-package

# or via NPM
npm install @metafi/metafi-js-package

Step 2: Setup User Login

Go to your project page in the Developer Portalarrow-up-right and navigate to Settings. There you can update the URL which we will use to authenticate your user token. Once this URL is updated, you can create a wallet for a user by passing in their userIdentifier and jwtToken into our SDK.

More information on this can be found in the Login section of our documentation.

import { Login } from '@metafi/metafi-js-package';
import { getLoginToken } from './controllers/login'

function App() {

    const handleLogin = async () => {
        var email = "[email protected]";
        var jwtToken = getLoginToken(email);  // your logic to login user
        
        var result = await Login(
            email,
            jwtToken,
            "YOUR-API-KEY",
            "YOUR-SECRET-KEY"
        );
        
        console.log("Login results", result);
    }
    
    return (
        <div>
	    <button onClick={handleLogin}>Handle login</button>
        </div>
    );
}

export default App;

Step 3: Function Invocation

You're done! You can now invoke the functions that you need.

Last updated