verse-embedded
v1.0.4
Published
Lightweight library for embedding Verse artwork iframes
Downloads
131
Readme
Verse Embedded
A lightweight library for embedding Verse artwork iframes on any website.
Installation
- Build the library:
npm install
npm run build- Include the built script in your HTML:
<script src="path/to/verse-embedded.js"></script>Usage
- Add a container div with the
verse-artwork-idattribute:
<div verse-artwork-id="123"></div>- The library will automatically:
- Find all elements with the
verse-artwork-idattribute - Create an iframe for each artwork
- Show a loading spinner while the iframe is loading
- Replace the spinner with the artwork once loaded
- Find all elements with the
Customization
You can customize the base URL by creating a new instance of VerseEmbed:
const verseEmbed = new VerseEmbed({
baseUrl: "https://custom-verse-url.com/artworks",
});
verseEmbed.initialize();Development
npm run build- Build the librarynpm run dev- Watch for changes and rebuildnpm run type-check- Run TypeScript type checking
Requirements
- Modern browser with ES2020 support
- TypeScript 5.3.3 or higher (for development)
