• Parses the config.json produced by the Showpad experience app editor into the platform’s computed schema.

    ⚠️ This method is only applicable to apps built with the standard Showpad experience app editor. If your app uses a Custom Editor, use getConfig instead. Calling it with a Custom Editor config throws an error.

    The config.json is generated by the platform from the editor definition. This function standardizes it so it can be used safely at runtime:

    • Empty labels, contents and assets are returned as empty objects
    • Labels are normalized to Label objects ({ value })
    • Assets are standardized to the Asset type, keyed by asset id

    Consumers may extend the base configuration type to include additional application-specific fields via generics.

    Throws

    If the config was not created with the standard Showpad experience app editor (e.g. a Custom Editor config). Use getConfig instead.

    Example

    // config.json
    {
    "version": 1,
    "labels": {
    "labels_sample": ""
    },
    "contents": {
    "contents_sample": {
    "type": "asset"
    }
    }
    }

    // main.ts
    import { Showpad } from '@showpad/experience-app-sdk'

    interface ConfigJSON extends Showpad.ConfigJSON {
    labels: {
    labels_sample: Showpad.Label
    }
    contents: {
    contents_sample: Showpad.ContentAsset
    }
    }

    const configJSON = await Showpad.parseConfig<ConfigJSON>()

    Type Parameters

    • T extends ConfigJSON = ConfigJSON

      Generic to completely type your config.json structure.

      Use Label or one of the Content interfaces to get maximum type support. See example.

    Parameters

    Returns Promise<T>

    the standardized config.json from the experience app editor.

Generated using TypeDoc