---
title: ServerModuleSpec
description: A plugin's server module and the JSON options its factory receives.
updated_at: '2026-11-19T06:37:33+01:00'
created_at: '2026-11-11T09:53:08+01:00'
symbol:
  kind: interface
  name: ServerModuleSpec
  signatures:
    - interface ServerModuleSpec<Options = unknown>
  typeParameters:
    - name: Options
      default: unknown
  members:
    - name: module
      kind: property
      signature: 'readonly module: string'
      description: >-
        Absolute path, `file:` URL or package specifier of a module whose
        default export is a
        [[reference/api/core/ServerModuleFactory|ServerModuleFactory]].
    - name: options
      kind: property
      signature: 'readonly options?: Options'
      description: >-
        JSON-serializable. Name secrets with `{ env: "NAME" }`; read them from
        `context.env` per request.
    - name: eager
      kind: property
      signature: 'readonly eager?: boolean'
      description: >-
        Run this plugin's factory before the site answers its first request at
        runtime (a page, a plugin or one of the app's own routes), instead of on
        this plugin's own first request. For a plugin whose factory sets up what
        other code reads, as `auth`'s does with its admins. A factory that
        throws fails every request until it starts.
    - name: pages
      kind: property
      signature: 'readonly pages?: readonly string[]'
      description: >-
        Pages this plugin renders in the theme shell. Each name claims
        `<base><mount>/-/<name>/` and every path below it, such as `account` for
        `/-/account/`, or `history` for `/-/history/notes/intro/`. Names follow
        the plugin id rules, and no two plugins on a vault may claim one. The
        factory's `page` renders them.
  source: >-
    https://github.com/mia-cx/svartz/blob/711f3906a713c8b9a5a572d0f34c85e90c3bc3d1/packages/core/src/plugin/server.ts#L32
---

# ServerModuleSpec
