본문으로 건너뛰기

Lib

The sdk.lib object provides access to a curated set of third-party libraries that are safely exposed within the MonoChat environment. These libraries can be used in your Custom View functions to extend functionality, integrate with APIs, parse files, and more.

팁

💡 The list of available libraries may grow over time. Always refer to the latest MonoChat SDK documentation or contact support for an up-to-date list.


Available Libraries​

OpenAI​

Provides access to the official OpenAI SDK. You can use it to interact with OpenAI APIs if authorized and configured.

const openai = new sdk.lib.OpenAI({ apiKey: '...' })
const response = await openai.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello world!' }]
})

fetch​

Standard Fetch API to make HTTP requests.

const response = await sdk.lib.fetch('https://api.example.com/data')
const json = await response.json()

pdfjsLib​

Allows reading and parsing PDF files.

const pdf = await sdk.lib.pdfjsLib.getDocument({ data: fileBuffer }).promise
const page = await pdf.getPage(1)
const text = await page.getTextContent()

Buffer​

Node.js Buffer API for encoding, decoding, and binary operations.

const buffer = sdk.lib.Buffer.from('hello world')
console.log(buffer.toString('base64'))

Notes​

  • Libraries are sandboxed and safe to use inside the MonoChat runtime.
  • Some libraries (e.g. OpenAI) require API keys or setup.
  • New libraries may be added progressively—reach out if you need support for a specific one.