Skip to main content

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

  1. Get an encryption key from the partner portal
  2. Create an onboarding payload for your user
  3. Create a JME token on the backend
  4. 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 webhooks section and retrieve your "JWE encryption public key" (It should start with -----BEGIN PUBLIC KEY-----)
  • Go to the App setting section and retrieve your partnerName

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 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
>
Congratulations!

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