<aside> ⚓ Table of Contents

</aside>

1. Widget Integration

Video instruction

You can now integrate the widget in 3 ways:

  1. put a link/button in your product, which will open a web-browser window with a link like https://widget.nearpay.co/?some-get-params...;

  2. put an iframe in your website, which will open our widget directly on your page like here:

    Demo of an iframe widget integration

    Demo of an iframe widget integration

  3. integrate our SDK into your existing application

All ways support initial params which you can pass to our widget. For example, set the sum of crypto or fiat, set cryptocurrency, set receiver wallet, etc.

1.1. Link-way

For creating a link to our widget with your params, you need to:

  1. Create some backend endpoint with a generating sign function
  2. Pass your init params to this route and get your request sign
  3. Pass request sign and init-params to our widget as GET params

1.1.1. Example

  1. We want to allow our users to buy NEAR. Let’s set our init-params:
toCurrency=NEAR,
toWallet=your_user.near
  1. Then we need to send it to backend and generate a sign.

<aside> ℹ️ Learn more about request signing and how to do it!

</aside>

  1. Generate link by putting all of you init-params and a sign in GET params: