API reference

Complete prop and event reference for the React, Vue and vanilla interfaces. All three share identical names and types.

Props

NameTypeDefaultDescription
apiKeystringLicense key. Required. Rejected if origin is not on the license.
imageUrlstring?Initial image. If omitted, editor shows a file picker.
onSave(blob: Blob) => voidFires with the flattened output when the user clicks Save. Required.
onClose() => voidFires on the Cancel button. Dismiss your modal here.
onReady() => voidFires once the canvas mounts and the initial image renders.
optionsEditorOptionssee belowTool visibility, ratios, output format and locale.

EditorOptions

types.ts
interface EditorOptions {
  /** Whitelist of aspect ratios shown in the Crop tool. */
  aspectRatios?: Array<"free" | "1:1" | "4:3" | "16:9" | "9:16">;

  /** Show the Filters tool. Default true. */
  filters?: boolean;

  /** Show the Annotate tool (text, arrow, box). Default true. */
  annotations?: boolean;

  /** Show the Resize tool (width/height inputs). Default true. */
  resize?: boolean;

  /** Output MIME. Default "image/png". */
  outputFormat?: "image/png" | "image/jpeg" | "image/webp";

  /** Quality for lossy formats, 0..1. Default 0.92. */
  outputQuality?: number;

  /** Longest-edge clamp for the exported image. Default 8192. */
  maxOutputDimension?: number;

  /** Locale code for tool labels. Defaults to "en". */
  locale?: string;
}

Events

  • onSave(blob) — user clicked Save
  • onClose() — user clicked Cancel
  • onReady() — canvas mounted, first frame rendered
  • onError(error) — license rejected or image load failed

Imperative handle (React)

ImperativeExample.tsx
import { useRef } from "react";
import { EditpixEditor, EditpixHandle } from "@editpix/react";

export function Example() {
  const ref = useRef<EditpixHandle>(null);

  return (
    <>
      <button onClick={() => ref.current?.exportBlob()}>Export now</button>
      <EditpixEditor ref={ref} apiKey={KEY} imageUrl={url} onSave={upload} />
    </>
  );
}

Verify license endpoint

The editor calls GET /api/verify-licenseon the origin of the script. If you’re self-hosting the bundle, proxy this request to https://editpix.dev/api/verify-license.

Request / response
GET /api/verify-license?apiKey=pk_live_3f2d9c&domain=shoplane.com
→ 200 { "valid": true, "plan": "studio" }
→ 200 { "valid": false, "reason": "domain_not_allowed" }