<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASCredentialExportManager",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "s:22AuthenticationServices25ASCredentialExportManagerC"
  },
  "title" : "ASCredentialExportManager"
}
-->

# ASCredentialExportManager

A class to manage exporting credentials.

```
class ASCredentialExportManager
```

## Overview

`ASCredentialExportManager` allows your app to exchange authentication credentials like passwords and passkeys with other apps.
Participating apps such as password managers can receive your exported credentials by using the [`ASCredentialImportManager`](/documentation/AuthenticationServices/ASCredentialImportManager) class.

### Configure your app

To participate in credential exchange, edit your credential provider extension’s information property list and add the following key with a Boolean value of `YES`:

`NSExtension > NSExtensionAttributes > ASCredentialProviderExtensionCapabilities > SupportsCredentialExchange`

Also, declare the versions of the credential data format your app supports using the following key:

`NSExtension > NSExtensionAttributes > ASCredentialProviderExtensionCapabilities > SupportedCredentialExchangeVersions`

The value is an array of strings containing every version your app supports.
Currently the only available version is `1.0`.

### Export credentials

To export credentials, your app’s interface needs to allow the person using it to select the credentials they want to export.
To begin the process, call the [`requestExport(for:)`](/documentation/AuthenticationServices/ASCredentialExportManager/requestExport(for:)) method on an instance of this class.
Calling this method brings up an out-of-process system UI that guides the person through the export procedure.
The system UI explains the risks of exporting credentials, and then allows them to choose an app to export to.
The operating system acts as an intermediary to establish the identities of the password manager apps involved and performs the exchange; this process doesn’t write any data to the file system.

When a person chooses an importer app, the system launches it, sending an <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> whose <doc://com.apple.documentation/documentation/Foundation/NSUserActivity/activityType> is `ASCredentialExchangeActivity`.
The importing app responds to the launch activity by calling the [`ASCredentialImportManager`](/documentation/AuthenticationServices/ASCredentialImportManager) method [`importCredentials(token:)`](/documentation/AuthenticationServices/ASCredentialImportManager/importCredentials(token:)) to receive the exported credentials.

When a person chooses an importer app, the [`requestExport(for:)`](/documentation/AuthenticationServices/ASCredentialExportManager/requestExport(for:)) method returns an [`ASCredentialExportManager.ExportOptions`](/documentation/AuthenticationServices/ASCredentialExportManager/ExportOptions) structure that describes the credential data format version you should use to ensure the importer app can successfully decode the data.
Use this version to construct your [`ASExportedCredentialData`](/documentation/AuthenticationServices/ASExportedCredentialData) object, then call [`exportCredentials(_:)`](/documentation/AuthenticationServices/ASCredentialExportManager/exportCredentials(_:)) with it.
After the system receives your data, the system launches the importer app, sending the <doc://com.apple.documentation/documentation/Foundation/NSUserActivity> `ASCredentialExchangeActivity`.
The importing app responds to the launch activity by calling the [`ASCredentialImportManager`](/documentation/AuthenticationServices/ASCredentialImportManager) method [`importCredentials(token:)`](/documentation/AuthenticationServices/ASCredentialImportManager/importCredentials(token:)) to receive the exported credentials.

The following example shows how to perform an export from a SwiftUI view.
The example assumes the typical case where the app has a single credential provider extension, which means it can pass `nil` to [`requestExport(for:)`](/documentation/AuthenticationServices/ASCredentialExportManager/requestExport(for:)).

```swift
struct CredentialExportManagerExample: View {
    @Environment(\.credentialExportManager) private var credentialExportManager

    var body: some View {
        Button("Export Credentials") {
            Task {
                do {
                    let exportOptions = try await credentialExportManager.requestExport()
                    let credentialData = getCredentialData(exportOptions: exportOptions) // defined elsewhere
                    try await credentialExportManager.exportCredentials(credentialData)
                } catch {
                    // Handle the export error.
                }
            }
        }
    }
}
```

For a corresponding import code example, see [`ASCredentialImportManager`](/documentation/AuthenticationServices/ASCredentialImportManager).

## Topics

### Creating an export manager

[`init(presentationAnchor:)`](/documentation/AuthenticationServices/ASCredentialExportManager/init(presentationAnchor:)-56ki6)

Creates an export manager, anchored by the given AppKit window.

[`init(presentationAnchor:)`](/documentation/AuthenticationServices/ASCredentialExportManager/init(presentationAnchor:)-904gt)

Creates an export manager, anchored by the given UIKit window.

[`ASPresentationAnchor`](/documentation/AuthenticationServices/ASPresentationAnchor)

A platform-specific type that indicates the kind of user interface element to use as a presentation anchor.

### Exporting credentials

[`requestExport(for:)`](/documentation/AuthenticationServices/ASCredentialExportManager/requestExport(for:))

Begins the export process.

[`ASCredentialExportManager.ExportOptions`](/documentation/AuthenticationServices/ASCredentialExportManager/ExportOptions)

Options that configure the behavior of a credential export operation.

[`exportCredentials(_:)`](/documentation/AuthenticationServices/ASCredentialExportManager/exportCredentials(_:))

Exports the provided credential data.

[`ASExportedCredentialData`](/documentation/AuthenticationServices/ASExportedCredentialData)

A container for credential data that your app provides to an exporter or receives from an importer.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)