Nexo Maker Docs
  • Welcome
  • Getting Started
    • Basic Concepts
      • Starting a Expansion
      • Compiling your Expansion
  • Visual API
    • Modularjs
      • Modularjs Basics
      • Styling
      • useState()
      • useEffect()
      • useGlobalState()
      • useProjectState()
    • [Deprecated] Components
      • Custom HTML documents
    • Themes
      • Replace Assets
      • Assets List
  • Functional API
    • Post Functions
      • Post Sidebar Button
      • Post Editor Module
    • Get Functions
      • Load Assets
      • Load File
      • Get Project
  • API Changelogs
    • Changelog 0.6.1
Powered by GitBook
On this page
  1. Visual API
  2. Themes

Replace Assets

Use postAsset() to register dynamic assets so your Expansion can safely display them in the frontend.

To be able to send any assets to the client, you first need to load them in a way the Nexo Maker's client will understand, for this reason, any asset as to be loaded into a variable using

Posting Assets with postAsset()

nm.postAsset({
  Add: base64Data
});

💡 Example Usage

const icon = await api.nexomaker.imgconvert(__dirname + "/assets/add-icon.png");

nm.postAsset({
  Add: icon
});

⚠️ Notes

  • Keys are injected as global variables inside your Expansion's UI context.

  • Keep keys short and unique to avoid conflicts.

PreviousThemesNextAssets List

Last updated 18 days ago