Skip to main content

Type Alias: GetModularShareUrl()

GetModularShareUrl = (codeOnly?) => Promise<string | null>

Function

Generates a shareable URL for the current modular scene configuration.

This function creates a URL that encapsulates the current state of the modular scene, allowing it to be shared with others or bookmarked for later access. The URL includes a shortcode that represents the complete scene configuration.

Shareable URLs enable collaboration by allowing designs to be easily shared with colleagues, clients, or other stakeholders via email, messaging, or other channels.

Parameters

codeOnly?

boolean

If true, returns only the shortcode rather than the complete URL

Returns

Promise<string | null>

The shareable URL or shortcode, or null if generation fails

Example

// Generate and copy a shareable URL to the clipboard
document.getElementById('share-btn').addEventListener('click', async () => {
const shareUrl = await window.mimeeqApp.actions.getModularShareUrl();

if (shareUrl) {
navigator.clipboard.writeText(shareUrl)
.then(() => alert('Share link copied to clipboard!'))
.catch(err => console.error('Could not copy URL: ', err));
} else {
alert('Could not generate share link');
}
});