There are three ways to include Swappit in your project: npm, CDN, or direct download. All three deliver the same single file —Documentation Index
Fetch the complete documentation index at: https://mintlify.com/soyleninjs/swappit/llms.txt
Use this file to discover all available pages before exploring further.
swappit.min.js — and all three expose the same global window.Swappit class and register the <swappit-instance> custom element as soon as the script is parsed. Choose whichever method fits your project’s tooling.
Install via npm
Install the package from the npm registry:Then include the built file in your HTML with a
<script> tag pointing to the file inside node_modules:The package does not provide an ES module export (
import/export). You must include it as a classic <script> tag. Once loaded, window.Swappit is available globally in the browser.Load from CDN
Reference Swappit directly from jsDelivr — no installation required:This is the fastest way to prototype. jsDelivr serves the file from a global CDN, so the script loads quickly for users anywhere in the world. The URL always resolves to the latest published version on npm; pin a specific version by appending
@3.0.0 to the package name if you need a stable reference:Direct download
Download This method is ideal when you want full control over versioning and do not use a package manager or CDN.
swappit.min.js from the GitHub Releases page, place it anywhere in your project, and include it with a <script> tag:swappit.min.js bundles both the Swappit class and the <swappit-instance> custom element in a single file. Once the script is loaded, window.Swappit is available globally and the <swappit-instance> custom element is registered and ready to use — no further initialization is needed.