Documentation Index Fetch the complete documentation index at: https://nvd-54.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
兼容性 Only available on Node.js.
This covers how to load document objects from pages in a Confluence space.
You’ll need to set up an access token and provide it along with your confluence username in order to authenticate the request
You’ll also need the space key for the space containing the pages to load as documents. This can be found in the URL when navigating to your space e.g. https://example.atlassian.net/wiki/spaces/{SPACE_KEY}
And you’ll need to install html-to-text to parse the pages into plain text
npm install @langchain/community @langchain/core html-to-text
import { ConfluencePagesLoader } from "@langchain/community/document_loaders/web/confluence" ;
const username = process . env . CONFLUENCE_USERNAME ;
const accessToken = process . env . CONFLUENCE_ACCESS_TOKEN ;
const personalAccessToken = process . env . CONFLUENCE_PAT ;
if (username && accessToken) {
const loader = new ConfluencePagesLoader ( {
baseUrl : "https://example.atlassian.net/wiki" ,
spaceKey : "~EXAMPLE362906de5d343d49dcdbae5dEXAMPLE" ,
username ,
accessToken ,
} ) ;
const documents = await loader . load () ;
console . log (documents) ;
} else if (personalAccessToken) {
const loader = new ConfluencePagesLoader ( {
baseUrl : "https://example.atlassian.net/wiki" ,
spaceKey : "~EXAMPLE362906de5d343d49dcdbae5dEXAMPLE" ,
personalAccessToken ,
} ) ;
const documents = await loader . load () ;
console . log (documents) ;
} else {
console . log (
"You need either a username and access token, or a personal access token (PAT), to use this example."
) ;
}
将这些文档连接到 Claude、VSCode 等工具,通过 MCP 获取实时答案。