Add a link to open melio
A standalone experience is the easiest way to get started embedding Melio in your app.
You simply add a button or link in your app to open a white-labeled experience that has all of Melio's features and capabilities while seamlessly onboarding your users.
This guide will help you setup this experience in a few simple steps
- Get an encryption key from the partner portal
- Create an onboarding payload for your user
- Create a JME token on the backend
- Add the link to your website
Get an encrpytion key from partner portal
- Log in to our Partner Portal using the credentials provided to you.
- Go to the
Api and webhookssection and retrieve your "JWE encryption public key" (It should start with-----BEGIN PUBLIC KEY-----) - Go to the
App settingsection and retrieve yourpartnerName
Create an onboarding payload for your user
To seamlessly onboard your users, you need to collect some user information into a json format that we will later encrypt. You can see the full details that you can provide in Reference/Embedding/API specifications.
To begin we'll set the minimum amount of data you have to provide (the rest Melio can collect on your behalf when the user enters):
const onboardingPayload = {
user: { id: "us142664", email: "jhon.doe@gmail.com" },
company: { id: "ac51512" },
};
Create a JME token on the backend
On your server add the following to generate a token:
const jose = require("jose"); // Jose is a robust and secure JME library
const crypto = require("crypto");
const publicKey = crypto.createPublicKey(publicKey); // publicKey should be the key from step #1 , including -----BEGIN PUBLIC KEY-----
const jwe = await new jose.CompactEncrypt(
new TextEncoder().encode(onboardingPayload),
)
.setProtectedHeader({ alg: "RSA-OAEP-256", enc: "A256GCM" })
.encrypt(publicKey);
Add the link to your website
Add a link in your webpage to redirect the user to Melio -
<a
href="https://partnerships.public-qa.melioservices.com/<partnerName>/auth?token=<jwe>"
>Pay bills</a
>
You've integrated Melio into your app
Next steps
- Configure branding and theme for your App
- Provide additional onboarding data for smoother first time experience
- Read more about the various way you can authenticate with Melio