Just a few simple steps to use Copy to Design SDK in your project
pnpm install @refore-ai/copy-to-design-sdk
import { CopyToDesign, PlatformType } from '@refore-ai/copy-to-design-sdk';
const copyToDesign = new CopyToDesign({
key: '<YOUR_KEY>',
});
const html = '<html><body>Here is my content</body></html>';
// Copy one page
await copyToDesign.copyToClipboardFromHTML(html, {
width: 1920,
height: 1080,
platform: PlatformType.Figma,
});
// Copy multiple pages at once
const html2 = '<html><body>Second page</body></html>';
await copyToDesign.copyToClipboardFromHTML([html, html2], {
width: 1920,
height: 1080,
platform: PlatformType.Figma,
});