🖥 SDK Documentation (BETA)
The easiest way to integrate Koywe
See it in action: You can see how we integrate our own widget at https://widget.koywe.com and clone the Github repo to start building your own project
BETA: SDK Widget
Our SDK is an NPM package, installed in your project. You can configure some parameters to make it easier for your users and even skip some steps if you include a Client ID.
Activating the widget will display an overlay where your users will go through the Buy Process and, coming soon, the Sales on, without leaving your website or app.
Installation
Run npm i @koyweforest/koywe-ramp-sdk
inside your project’s folder. You can
also use yarn
Configuration and Use
Using the widget is very simple. For example, showing the ramp at the click of a button:
You can add some parameters to make it easier for your users:
currencies
A list of currencies that will be offered to the user. By default, all currencies are shown.
You must pass an array of strings, each value containing the symbol of the currencies. You can obtain a full list of available fiat currencies at https://koywe.com
In this example, the user will only be allowed to select CLP, MXN, COP, and PEN.
If you pass an empty array, it will be ignored and default values will be shown. You can add any string, invalid values will be ignored.
tokens
The list of tokens allowed to purchase or sell. By default, all available tokens for the given currency are shown.
You must pass an array of strings, each value containing the symbol of the tokens. Multi-chain tokens, such as USDC, should be listed individually according to the default list. For example, USDC on Polygon should be passed as “USDC Polygon”. You can obtain a full list of available crypto tokens at https://koywe.com
In this example, only ETH will be available to transact.
If you pasa an empty array, it will be ignored and default values will be shown. You can add any string, invalid values will be ignored.
Important: Non-existent pairs will be ignored. For example, if there are no prices in PEN for the BNB token, when the user selects PEN, the token will not be displayed, even if there are prices in other currencies.
address
Optional string parameter to setup a wallet address, skipping the step for the user.
An invalid or malformed address will be ignored and the user will have to input a valid one manually.
String parameter to link a user to the transaction. If it’s a valid email, the widget will trigger an email with an OTP code and ask for it to the user.
Providing an email will prevent the user from modifying it and WILL have to use the address to buy or sell crypto.
callbackUrl
String param containing a valid URL to redirect after paying or navigating outside the widget.
If you don’t specify a valid URL, the user will be redirected to Koywe’s website after finishing the transaction.
clientId
Optional parameter containing the Client ID to use on the widget. Depending on the agreement with Koywe, this ID allows access to different payment methods and conditions.
If no id is passed, the widget will replicate functionality at https://koywe.com
Checkout our Credentials sections to learn more and find out how to get your own ID.
testing
Optional boolean parameter to activate testing mode (fake transactions).
If parameter is not passed or is passed as false, the widget will point to production (real money).