Behaviour for exporting user data.
Sigra provides a versioned export contract for Sigra-owned auth and account data. Application developers implement this behaviour to add host-app data alongside the Sigra-owned export.
Usage
defmodule MyApp.DataExport do
@behaviour Sigra.DataExport
@impl true
def export_user_data(user) do
{:ok, %{
profile: %{name: user.name, bio: user.bio},
posts: MyApp.Posts.list_by_user(user.id)
}}
end
end
Summary
Callbacks
Export all data associated with the given user.
Functions
Exports Sigra's own auth data for a user.
Callbacks
Functions
Exports Sigra's own auth data for a user.
Returns a versioned map describing Sigra-owned auth/account surfaces for the user. The payload is intentionally explicit and stable so host apps can present or archive it without reverse-engineering Sigra internals.
Options
:session_schema- The generated UserSession Ecto schema module.:identity_schema- The generated UserIdentity Ecto schema module.:audit_schema- The generated AuditEvent schema module.:mfa_credential_schema- The generated MFA credential schema module.:backup_code_schema- The generated backup code schema module.:user_passkey_schema- The generated passkey schema module.:membership_schema- The generated organization membership schema module.