Member Junction
    Preparing search index...

    Interface ServerExtensionInitContext

    Context passed to BaseServerExtension.Initialize() and OnAllExtensionsMounted().

    interface ServerExtensionInitContext {
        apiRootPath?: string;
        app: Application;
        config: ServerExtensionConfig;
        httpServer?: Server;
        phase: ServerExtensionPhase;
        publicUrl?: string;
        services: ServerExtensionServiceRegistry;
    }
    Index

    Properties

    apiRootPath?: string

    MJAPI's base path (MJAPI_BASE_PATH, no trailing slash; '' at /): the prefix every MJAPI route is mounted under. config.RootPath is already composed under it, so mount on config.RootPath as-is. Not related to GRAPHQL_ROOT_PATH, which is only Apollo's path. Browser bundles are given the MJAPI URL explicitly; they never derive it from window.location or by stripping /graphql.

    app: Application

    Express application instance to mount routes on.

    Extension configuration from mj.config.cjs or Open App metadata.

    httpServer?: Server

    Node HTTP/HTTPS server instance, if available (e.g. for WebSocket attachment).

    Current lifecycle phase being mounted ('pre-auth' | 'post-auth').

    publicUrl?: string

    Where the world reaches MJAPI (MJAPI_PUBLIC_URL), prefix included (e.g. 'https://example.com/api'). Build outward URLs as publicUrl + a path relative to apiRootPath — never by appending the already-composed config.RootPath to it.

    Shared service registry for cross-extension service lookup and registration.