@nolgard/webapps-appdata
v0.1.2
Published
Standardized appData bridge for Pinecone webapps
Readme
@nolgard/webapps-appdata
Bridge package for Pinecone webapps that exposes runtime props to the shared appData store.
Exports
parseAddonInstanceConfig(value)resolveAddonRuntimePropsFromDataset(dataset, element?)
Behavior
- Copies dataset values into a plain props object
- If
elementis passed, reads config from its inline<script type="application/json" data-addon-instance-config>child first (this is how the server renders it, instead of a large escaped attribute) - Falls back to parsing
data-addon-instance-config/data-addon_instance_configfrom the dataset when no inline script is found (used by the editor's live preview) - Merges parsed config onto props
- Writes the final props into
appData - Returns the props object for the host component
