> For the complete documentation index, see [llms.txt](https://docs.sudoplatform.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sudoplatform.com/guides/password-manager/vault-import-and-export.md).

# Vault Import and Export

{% hint style="warning" %}
This feature is only available in the JS SDK.
{% endhint %}

## Importing Vault Data

To make the transition easier for users to switch to using the Sudo Password Manager, the JS SDK provides a transformer that will accept vault files from other password managers. The transformer takes a file and returns a list of `ItemInput`. Those inputs have not been added to the vault, but allows the user to edit the data further if needed. After the data has been transformed, the data can be added to the vault calling the `addBatchItems` method.&#x20;

{% tabs %}
{% tab title="TypeScript" %}

```typescript
try {
  const vaultId = /* Id of the vault to add the data to */
  const file = /* the vault data to upload */
  const items = await transformData('firefox', file)
  const result = await client.addBatchItems(vaultId, items)
} catch {
  // Handle/notify user of errors
}
```

{% endtab %}
{% endtabs %}

### Supported Vault Imports

Currently the Sudo Password Manager provides data transformation for the following password managers and file formats. However, any password manager can be added to the vault adhering to the Sudo Platform's generic CSV file.&#x20;

* 1Password (CSV)
* Dashlane (CSV, and zip)
* Chrome Browser (CSV)
* Firefox Browser (CSV)
* Safari Browser (CSV)
* Edge Browser (CSV)

## Exporting Vault Data

If the user needs to export vault data, the client provides an `exportVault` method that will return a given vault's content in a string format to save as a CSV file.

{% tabs %}
{% tab title="TypeScript" %}

<pre class="language-typescript"><code class="lang-typescript"><strong>try {
</strong>  const vaultId = /* the vault id of the vault to export*/
  const fileContents = await client.exportVault(vaultId)
} catch {
  // Handle/notify user of errors
}
</code></pre>

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
When the client exports vault data, the client decrypts secure values and returns the secure values as plaintext. Handle the data appropriately.&#x20;
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sudoplatform.com/guides/password-manager/vault-import-and-export.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
