# Host Integration Guide

UnifiedFiler is a Host-embedded AMD package. Host systems should initialize services, register adapters, then embed FileExplorer / FilePicker / FileSaver as needed.

## RequireJS package

```javascript
require.config({
  paths: {
    UnifiedFiler: './UnifiedFiler/scripts'
  }
});
```

## HostIntegrationService

```javascript
require(['UnifiedFiler/main'], function (UnifiedFiler) {
  var integration = new UnifiedFiler.services.HostIntegrationService({
    host: window.AppHost
  });

  integration.registerAssociation('.uwpsx', {
    open: function (entry) {
      return window.AppHost.launch('OfficeDoc', { fileEntry: entry });
    }
  });
});
```

## Standard profiles

```javascript
var pickerOptions = integration.createPickerOptions('office', {
  defaultStorage: 'googleDrive'
});

var saverOptions = integration.createSaverOptions('editor', {
  overwriteMode: 'confirm'
});
```

## FileService batch APIs

```javascript
fileService.copyEntries(entries, 'googleDrive', '/Documents', {
  conflictMode: 'rename'
});

fileService.exportFile(entry, 'application/pdf');
```
