Nutrient Web SDK
    Preparing search index...

    Type Alias InstanceGetter

    InstanceGetter: () => NutrientViewer.Instance | null

    A callback function that returns a slot configuration. This provides a standard way to customize various slots.

    The SDK internally calls this function as it prepares to render the associated component. Some slots can render before load() resolves, so call getInstance() when you need to use the public SDK instance. It returns null until the instance is available.

    You can think of it as an initialization phase for the slot. It receives two parameters: getInstance and id.

    • getInstance returns the latest Nutrient Web SDK instance, or null before the instance is available.
    • id is a unique identifier for the specific component being rendered into the slot. A component, such as comment thread, can have multiple instances, and the id helps to differentiate between them.

    Type Declaration

    Customizing the comment thread slot with a callback function follows this pattern:

    NutrientViewer.load({
    // ... Your configuration.
    ui: {
    commentThread: (getInstance, id) => {
    return {
    render: (params) => {
    const div = document.createElement("div");

    // Return a DOM Node.
    return div;
    },
    };
    },
    },
    });