Hosting Bring Your Own (BYO) Assets
Overview
Hosting Bring Your Own (BYO) external assets lets Creators Also known as Unqork Users, or Designer Users; is anyone who is inside the Unqork platform. host assets on a client-managed CDN (Content Delivery Network). To ensure secure access, the CDN must whitelist the client’s Unqork environment, allowing the Unqork Designer Platform to retrieve the bundle as needed.
The Bring Your Own framework is intended for developers who have a strong understanding of the Unqork Designer Platform and JavaScript JavaScript is an object-oriented computer programming language. It is most-commonly used for interactive effects in the browser..
Requirements
The following sections are requirements to bring your own assets into the Unqork Designer Platform:
Bundle Requirements
-
Must adhere to the BYO Component SDK.
-
Must be written in JavaScript JavaScript is an object-oriented computer programming language. It is most-commonly used for interactive effects in the browser..
-
Must be exported as valid ES module (not CJS or UMD)
-
Unqork recommends using bundlers to help with build options. For example: https://vite.dev/config/build-options#build-lib.
-
Scripts directly import by browser, compiled with es2020 in order to make sure it works across multiple browsers.
-
-
The bundle must not include any rendering libraries or frameworks like React, Angular, or Vue.
-
The default export must needs to expose the web component implementation
CDN Requirements
As long as your Unqork environment has access to the CDN, the bundled code will be retrievable.
Access
When using a CDN, there are two methods of access:
-
Making the CDN publicly accessible.
-
Whitelisting the Unqork environment on the CDN.
Example CDN Access Methods
You can use any CDN as long as it provides an accessible URL. If you do not have access to a CDN, consider the following examples to host external assets:
GitHub
A simple way to host your files using GitHub repositories or Gists.
Sign up for a GitHub account here: https://github.com/.
Steps to host external assets:
1. | Create a repository or Gist. |
2. | Add your sample code to the repository or Gist. |
3. | Obtain the link to the raw JavaScript JavaScript is an object-oriented computer programming language. It is most-commonly used for interactive effects in the browser. file ending in .js. |
4. | Follow the Unqork administration instructions to register your assets. |
Tiiny.host
A quick, free, and easy way to upload files to a CDN.
Sign up for a tiiny.host account here: https://tiiny.host/.
Steps to host external assets:
1. | Sign up for an account. |
2. | Upload your sample code. |
3. | Obtain the link to the raw JavaScript JavaScript is an object-oriented computer programming language. It is most-commonly used for interactive effects in the browser. file ending in .js. |
4. | Follow the Unqork administration instructions to register your assets. |
Resources
Bring Your Own (BYO) Framework Landing Page
Find all the resources needed to build your own components here.
Introduction to the Bring Your Own (BYO) Framework
Create a BYO Package
Understanding the manifest.json File
Learn about the file's specification, component and event definitions.
Understanding the BYO Runtime Engine API
Discover the interface between your custom BYO components and the Unqork platform.
Custom Component SDK
Extend component functionality in the Unqork Designer Platform.
Custom Component
Understand the state, interface, and events of a custom component.
BYO 7.22 Implementation Examples
Discover examples of component implementation using the 7.22 Unqork Designer Platform.
BYO 7.24 Implementation Examples
Discover examples of component implementation using the 7.24 Unqork Designer Platform.
BYO Best Practices
Learn about best practices for implementing and using BYO assets.