Enabling Authentication

You can add an authentication method to your docs.json to enable it on every page or you can set it on a per-page basis.

The page’s authentication method will override docs.json if both are set.

Bearer Token

"api": {
    "mdx": {
      "auth": {
        "method": "bearer"
      }
    }
}

Basic Authentication

"api": {
    "mdx": {
      "auth": {
        "method": "basic"
      }
    }
}

API Key

"api": {
    "mdx": {
      "auth": {
        "method": "key",
        "name": "x-api-key"
      }
    }
}

None

The “none” authentication method is useful to disable authentication on a specific endpoint after setting a default in docs.json.

---
title: "Your page title"
authMethod: "none"
---