Implement Kyvorn into your UI
This documentation shows how to implement Kyvorn API into your UI/app
Stay in the iBallexus Discord Server to get notified of the latest updates to the Kyvorn API
Setting up your UI
For this tutorial, I will create a basic UI card layout that will show information about the fetched items with a search. On click, it will open a popup menu that will show the raw script with a copy button.
You’ll need to open a new popup menu and make an API call to the Posts by ID endpoint in order to obtain script content, unless you get it from the raw script.
Modifying the pre-made Kyvorn API Template
Vulnerability Alert: Do not use this code example in a product environment! There are issues where RCE/XSS is possible by attackers via embedding script tags/iframe tags into their script upload, which can be used to perform malicious activity. You can get around this by manually embedding each form with textContent
instead of putting the entire thing in innerHTML
, which is insecure and can cause these vulnerabilities.
Out of date: This example is missing important new updates to the Kyvorn library that should be included in your website. Do not use it for production.
Using this implementation, we can easily embed the script library into an HTML page. You will need to edit this to work for you but it should mostly work. Get creative! Design awesome UIs and take advantage of the full possibilities of the Kyvorn Script Library!
Tip: Setting fallback images
In a great world, every script on Kyvorn would include images. In reality, however, not all scripts will include banner images. You’ll be left with an ugly banner image, usually transparent and not looking well. You can set an on error to image classes, or in our use case, the ||
block in our JS.
Need an image failed placeholder? Use Kyvorn’s: https://cdn.peretas.tech/imgfailed.png
As you can see in this example, the use of placeholder images make the Script Library look much more cleaner.
In this example, you can see that it looks goofy with the image unloaded thingy in the top. In our card.innerHTML
you can see our line of code:
You can replace this URL with anything, this will simply load https://cdn.peretas.tech/imgfailed.png
when script.scriptInfo.bannerUrl
is equal to null
. In HTML, you can also use the onerror
element to change the URL when it errors out:
This will instead load https://cdn.peretas.tech/imgfailed.png when any error occurs, which is more optimal to use if the image the user has provided has CORS enabled or is deleted.
Branding
Congratulations! You just included Kyvorn inside of your application! Now, you are able to include the special Uses Kyvorn API badge onto your executor’s website or Credits/Settings page. You can download it on our main page here.