SDK 명세

Zavilo 연동하기

개발자 도메인에서 SDK를 로드하고 Public Key로 초기화한 뒤 Tool ID로 기능을 호출합니다.

SDK 로드 및 초기화

<script src="https://sdk.zavilo.app/v1/zavilo.js"></script>

const client = await Zavilo.init({
  publicKey: "pk_live_xxxxxxxxx"
});

Headless

const result = await client.run("resize-image", {
  file,
  options: {
    width: 1200,
    keepAspectRatio: true,
    format: "webp",
    quality: 0.9
  }
});

const outputFile = result.files[0];

Interactive

await client.mount({
  tool: "resize-image",
  target: "#tool",
  mode: "interactive",
  input: { file },
  options: { width: 1200 },
  onComplete(result) {
    const outputFile = result.files[0];
  }
});

Embedded

await client.mount({
  tool: "compress-image",
  target: "#tool",
  mode: "embedded"
});

Schema 조회

Zavilo.listTools();
Zavilo.describe("resize-image");

client.listTools();
client.describe("resize-image");

Result 객체

{ tool, executionId, files: File[], data?, metadata? }