H5P NodeJS Library
    Preparing search index...

    The integration object is used to pass information to the H5P JavaScript client running in the browser about certain settings and values of the server.

    interface IIntegration {
        ajax: { contentUserData: string; setFinished: string };
        ajaxPath: string;
        baseUrl?: string;
        contents?: {
            [key: string]: {
                contentUrl?: string;
                contentUserData?: ISerializedContentUserData[];
                displayOptions: {
                    copy: boolean;
                    copyright: boolean;
                    embed: boolean;
                    export: boolean;
                    frame: boolean;
                    icon: boolean;
                };
                embedCode?: string;
                exportUrl?: string;
                fullScreen: "0"
                | "1";
                jsonContent: string;
                library: string;
                mainId?: string;
                metadata?: ILicenseData;
                params?: any;
                resizeCode?: string;
                scripts?: string[];
                styles?: string[];
                url?: string;
            };
        };
        core?: { scripts?: string[]; styles?: string[] };
        crossorigin?: any;
        crossoriginCacheBuster?: any;
        editor?: ILumiEditorIntegration;
        fullscreenDisabled?: 0 | 1;
        Hub?: { contentSearchUrl: string };
        hubIsEnabled: boolean;
        l10n: { [namespace: string]: any };
        libraryConfig?: { [machineName: string]: any };
        libraryUrl?: string;
        pluginCacheBuster?: string;
        postUserStatistics: boolean;
        reportingIsEnabled?: boolean;
        saveFreq: number | boolean;
        siteUrl?: string;
        url: string;
        urlLibraries?: string;
        user: {
            canToggleViewOthersH5PContents?: 0 | 1;
            id?: any;
            mail: string;
            name: string;
        };
    }
    Index

    Properties

    ajax: { contentUserData: string; setFinished: string }

    Type declaration

    • contentUserData: string

      The Ajax endpoint called when the user state has changed Example: /h5p-ajax/content-user-data/:contentId/:dataType/:subContentId?token=XYZ You can use these placeholders: :contentId (can be null for editor) :dataType (values: state or any string) :subContentId (seems to obsolete, always 0) The H5P client will replace them with the actual values.

    • setFinished: string

      An Ajax endpoint called when the user has finished the content. Example: /h5p-ajax/set-finished.json?token=XYZ Only called when postUserStatistics is set to true.

    ajaxPath: string
    baseUrl?: string

    The base URL, e.g. https://example.org

    contents?: {
        [key: string]: {
            contentUrl?: string;
            contentUserData?: ISerializedContentUserData[];
            displayOptions: {
                copy: boolean;
                copyright: boolean;
                embed: boolean;
                export: boolean;
                frame: boolean;
                icon: boolean;
            };
            embedCode?: string;
            exportUrl?: string;
            fullScreen: "0"
            | "1";
            jsonContent: string;
            library: string;
            mainId?: string;
            metadata?: ILicenseData;
            params?: any;
            resizeCode?: string;
            scripts?: string[];
            styles?: string[];
            url?: string;
        };
    }

    The key must be of the form "cid-XXX", where XXX is the id of the content

    core?: { scripts?: string[]; styles?: string[] }

    The files in this list are references when creating iframes.

    Type declaration

    • Optionalscripts?: string[]

      A list of JavaScript files that make up the H5P core

    • Optionalstyles?: string[]

      A list of CSS styles that make up the H5P core.

    crossorigin?: any

    Can be null.

    crossoriginCacheBuster?: any

    Can be null.

    We pass certain configuration values to the client with the editor integration object. Note that the way to pass these values to the client is NOT standardized and in the PHP implementation it is not the same in the Drupal, Moodle and WordPress clients. For our NodeJS version we've decided to put the values into the integration object. The page created by the editor renderer has to extract these values and put them into the corresponding properties of the H5PEditor object! See /src/renderers/default.ts how this can be done!

    fullscreenDisabled?: 0 | 1
    Hub?: { contentSearchUrl: string }
    hubIsEnabled: boolean
    l10n: { [namespace: string]: any }

    The localization strings. The namespace can for example be 'H5P'.

    libraryConfig?: { [machineName: string]: any }

    Can be null. The server can customize library behavior by setting the library config for certain machine names, as the H5P client allows it to be called by executing H5P.getLibraryConfig(machineName). This means that libraries can retrieve configuration values from the server that way.

    libraryUrl?: string

    The URL at which the core JavaScript files are stored.

    pluginCacheBuster?: string

    The cache buster appended to JavaScript and CSS files. Example: ?q8idru

    postUserStatistics: boolean

    If set the URL specified in ajax.setFinished is called when the user is finished with a content object.

    reportingIsEnabled?: boolean
    saveFreq: number | boolean
    siteUrl?: string

    Used when generating xAPI statements.

    url: string

    The URL at which files can be accessed. Combined with the baseUrl by the client. Example. /h5p

    urlLibraries?: string

    Used to override the auto-generated library URL (libraries means "content types" here). If this is unset, the H5P client will assume '/libraries'. Note that the URL is NOT appended to the url or baseUrl property!

    user: {
        canToggleViewOthersH5PContents?: 0 | 1;
        id?: any;
        mail: string;
        name: string;
    }

    Type declaration

    • OptionalcanToggleViewOthersH5PContents?: 0 | 1

      Usage unknown.

    • Optionalid?: any
    • mail: string
    • name: string