Skip to main content

💻 PolyswapApp

NPM Package​

https://www.npmjs.com/package/@polyswapai/widget?activeTab=readme

Installation​

From the root of your project, if you use YARN, run:

yarn add @polyswapai/widget

If you use NPM, run:

npm i @polyswapai/widget

Import​

Import the widget with:

import { PolyswapApp } from "@polyswapai/widget";

Rendering​

You can now render the widget as a component with

<PolyswapApp {
marketer={'polyswap-whitelabel'}
...config
} />

where config is an object specifying all the customizations.

Learn more about that in the implementation walkthrough.

Replace 'polyswap-whitelabel' with a string to identify your project e.g. your-project-name

info

Note that if you do not specify any custom configuration, you will get the default ones.

Summary​

Once you have installed the package with YARN or NPM, add the following code to one of your pages to render the widget with default options.

import { PolyswapApp } from "@polyswapai/widget";

export default function App() {
return (
<div className="App">
<PolyswapApp
marketer={'polyswap-whitelabel'}
/>
</div>
);
}