Poliage

Configuration Reference

Complete reference for the docsync.config.json configuration file.

File Location

The CLI looks for configuration in this order:

  1. Path specified via --config flag
  2. docsync.config.json in current directory
  3. poliage.config.json in current directory
  4. .poliage/config.json in current directory

Schema

{
  "$schema": "https://poliage.com/schemas/config.json",
  "project": "string",
  "version": "string",
  "defaults": { /* DefaultOptions */ },
  "captures": [ /* CaptureConfig[] */ ],
  "output": { /* OutputConfig */ }
}

Root Fields

project

Requiredstring

The project slug matching your Poliage dashboard project.

{
  "project": "my-documentation"
}

version

Requiredstring

Configuration schema version. Currently "1.0.0".

defaults

object

Default options applied to all captures unless overridden.

{
  "defaults": {
    "viewport": { "width": 1280, "height": 720 },
    "deviceScaleFactor": 2,
    "format": "png"
  }
}

captures

RequiredCaptureConfig[]

Array of capture configurations.

output

object

Output configuration.

{
  "output": {
    "directory": ".poliage/captures",
    "clean": true
  }
}

CaptureConfig

name

Requiredstring

Unique identifier for the capture. Used as the filename.

url

Requiredstring

URL to capture. Can include environment variables.

{
  "url": "https://app.example.com",
  "url": "${BASE_URL}/dashboard"
}

selector

string

CSS selector for element capture. If omitted, captures full page.

{
  "selector": ".main-content",
  "selector": "#login-form",
  "selector": "[data-testid='hero-section']"
}

viewport

object

Browser viewport dimensions.

{
  "viewport": {
    "width": 1280,
    "height": 720
  }
}

deviceScaleFactor

number • default: 1

Device pixel ratio. Use 2 for retina screenshots.

fullPage

boolean • default: false

Capture the full scrollable page instead of just the viewport.

padding

number | object

Padding around selected element.

{
  "padding": 16,
  "padding": { "top": 20, "right": 16, "bottom": 20, "left": 16 }
}

wait

object

Wait condition before capture.

{
  "wait": {
    "type": "selector",
    "value": ".content-loaded",
    "timeout": 5000
  }
}

Wait types:

TypeValueDescription
selectorCSS selectorWait for element to exist
visibleCSS selectorWait for element to be visible
hiddenCSS selectorWait for element to disappear
networkidleWait for network to be idle
timeoutmillisecondsWait for fixed time
functionJS codeWait for function to return true

auth

object

Authentication configuration.

{
  "auth": {
    "type": "cookie",
    "cookies": [
      {
        "name": "session",
        "value": "${SESSION_COOKIE}",
        "domain": "app.example.com"
      }
    ]
  }
}

Auth types:

TypeDescription
cookieSet cookies before navigation
basicHTTP Basic authentication
bearerBearer token in Authorization header

format

"png" | "jpeg" | "webp" • default: "png"

Output image format.

quality

number • default: 80

JPEG/WebP quality (1-100).

clip

object

Capture a specific region.

{
  "clip": {
    "x": 0,
    "y": 0,
    "width": 800,
    "height": 600
  }
}

actions

Action[]

Actions to perform before capture.

{
  "actions": [
    { "type": "click", "selector": ".menu-button" },
    { "type": "wait", "timeout": 500 },
    { "type": "type", "selector": "input", "text": "Hello" }
  ]
}

Action types:

TypePropertiesDescription
clickselectorClick an element
typeselector, textType into an input
scrollx, yScroll to position
waittimeoutWait milliseconds
hoverselectorHover over element
selectselector, valueSelect dropdown option

Complete Example

{
  "$schema": "https://poliage.com/schemas/config.json",
  "project": "my-saas-docs",
  "version": "1.0.0",
  "defaults": {
    "viewport": { "width": 1280, "height": 720 },
    "deviceScaleFactor": 2,
    "format": "png"
  },
  "captures": [
    {
      "name": "homepage",
      "url": "https://app.example.com"
    },
    {
      "name": "dashboard",
      "url": "https://app.example.com/dashboard",
      "auth": {
        "type": "cookie",
        "cookies": [{ "name": "session", "value": "${TOKEN}", "domain": "app.example.com" }]
      },
      "wait": { "type": "selector", "value": ".dashboard-loaded" }
    },
    {
      "name": "settings-modal",
      "url": "https://app.example.com/settings",
      "selector": ".settings-modal",
      "actions": [
        { "type": "click", "selector": ".open-settings-btn" },
        { "type": "wait", "timeout": 300 }
      ]
    }
  ],
  "output": {
    "directory": "./docs/screenshots",
    "clean": false
  }
}