@exalto / proof-embed
证明在你的页面的编辑,从证明自己的起源框,和存在设置。你的页面给它一个文档id和一种方式来获得会话令牌从你的服务器;一个人在编辑器里所做的一切都会直接被校对。
npm install @exalto/proof-embed
import { mountEditor } from "@exalto/proof-embed";
const editor = mountEditor(document.querySelector("#editor"), {
document: "doc_8Hq2Lm4R",
getToken: async () => {
const response = await fetch("/proof/session?doc=doc_8Hq2Lm4R", { method: "POST" });
return (await response.json()).token;
},
});
没有捆绑器,加载 https://embed.proof.exalto.ai/v1.js 相反,它会打开相同的函数 window.Proof.