Components
ElvixExport

ElvixExport

In-frame OTP-gated GDPR data export wizard (preview, send-to, otp, done) for identity or per-app scope.

What you'll receive

Your archive will contain a single JSON file with everything below, plus your avatar and banner images if you've uploaded any, plus a README that explains each section in plain language and includes the GDPR Art. 15(1) disclosures.

Loading

Not included: cryptographic key material on your passkeys, OAuth tokens, OTP codes, and any data the apps you use hold about you outside elvix. Contact each app for the latter.

app/account/export/page.tsx
"use client";
import { ElvixExport } from "@elvix.is/sdk/react";
export default function ExportPage() {
return (
<ElvixExport
target={{ kind: "identity" }}
onResult={(r) => {
if (!r.ok) return console.warn(r.error, r.message);
console.info("Export sent to", r.deliveredTo, "id:", r.downloadId);
}}
/>
);
}

Props

PropTypeRequiredDefaultDescription
target{ kind: "identity" } | { kind: "app"; appId: string; appName: string }optional{ kind: "identity" }Export scope. Locked at mount: to switch scope, unmount and remount.
primaryEmailstringoptionalsession emailDelivery inbox for the zip. Falls back to useElvixAppContext().user.email.
onSuccess(downloadId: string) => voidoptional(none)Fires before the in-frame done pane. If the host navigates or unmounts, the done pane is skipped (host wins).
onFail(error: string) => voidoptional(none)Notification hook. Fires alongside the in-frame error pane.
onResult(r: ElvixExportResult) => voidoptional(none)Unified discriminated-union callback for every terminal outcome. Success carries downloadId + deliveredTo, failure carries error + optional message.

target is locked at mount. The scope chooser (identity vs per-app) belongs in your route, not inside the SDK. Unmount and remount with a new target to switch.

The download link is single-use and expires 24h after issue. The zip is also emailed as an attachment to deliveredTo, so users who lose the in-frame link still have a copy. Don't surface downloadId outside the OTP-verified session.

Per-app scope

Pass appId + appName for a per-app archive, and optionally override the delivery inbox.

app/account/export/[appId]/page.tsx
<ElvixExport
target={{ kind: "app", appId: "app_01H...", appName: "Buildza" }}
primaryEmail="[email protected]"
/>

Related