# Construct 3 Integration

Add scripts in this order:

1. `runtime/nxar-zip-store-v4.js`
2. `runtime/nxar-runtime-v5.js`

The runtime exposes the NXAR Preview/Pro API through both:

```js
window.NANDAXResizerV5
window.NANDAXResizerV4
```

## License Flow

Free Preview works without activation for restricted core output. Activate with a G4S license-server key to unlock Pro packs, custom batch, and ZIP export:

```js
await NANDAXResizerV5.activateLicense("NXAR-XXXX-XXXX-XXXX-XXXX", {
  name: "Customer Name",
  email: "customer@example.com"
});
```

Validate an existing activation on startup:

```js
await NANDAXResizerV5.validateStoredLicense();
```

Check current state:

```js
const licensed = NANDAXResizerV5.isLicensed();
const state = NANDAXResizerV5.getLicenseState();
```

Deactivate this device:

```js
await NANDAXResizerV5.deactivateLicense();
```

Free Preview helpers:

```js
const preview = NANDAXResizerV5.isPreviewMode();
const rules = NANDAXResizerV5.previewRules();
```

## Asset Flow

```js
await NANDAXResizerV5.loadFile(file);
NANDAXResizerV5.buildQueue(selectedPacks, customText, dedupeMode);
await NANDAXResizerV5.generateCurrentQueue(options);
await NANDAXResizerV5.downloadGeneratedZip();
```

Free Preview allows limited core output. ZIP export and custom batch require a valid Pro activation.
