Skip to main content

@metadata

The @metadata decorator is used to mark the property that defines metadata for a NodeBlock. This metadata can then be retrieved by other blocks using the getMetadata function.

Decorator type

Property ℹ️

Applies to

Decorator signature

@metadata(reference: string)

Decorator parameters

NameTypeOptionalDescription
referencestringNoSpecifies the metadata reference.

Example

// Define metadata for a block
@metadata("example")
get metadata() {
return {
hello: "World!"
}
}

// Read metadata
const data: {
hello: string;
} = getMetadata(block, "example");