{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Journeys","product":"Identity Management","type":"markdown"},"seo":{"title":"Delete Data from SDK","description":"Everything about Mosaic Journeys, SDKs, and APIs","siteUrl":"https://developer.transmitsecurity.com"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"delete-data-from-sdk","__idx":0},"children":["Delete Data from SDK"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"badge-wrapper"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"className":"badge"},"children":["Client SDK"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"badge"},"children":["Backend API"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"badge"},"children":["Mobile approve"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"badge"},"children":["SSO"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"badge"},"children":["Sub-journey"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Delete data previously saved in the SDK."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"description","__idx":1},"children":["Description"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This step is used to remove data that was previously stored on the client by the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/journeys/store_data_on_sdk"},"children":["Save Data in SDK"]}," step. The data is stored in IndexedDB (Web), Keychain (iOS), or EncryptedSharedPreferences (Android), at the app (SDK instance) scope—not per journey."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can delete selected keys or clear all saved data for the app. A deleted key is fully removed, not left as an empty value. After the step runs, subsequent journey invocations no longer return that data through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@policy.sdkSavedData()"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Storage failures do not abort the journey; enable journey event reporting if you need a failed delete to appear in Journey Analytics."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When this step and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/journeys/store_data_on_sdk"},"children":["Save Data in SDK"]}," run in the same server response (no client-facing step between them), the SDK applies delete first, then save. Use that order when you need to drop previous session data and then persist a new value on the same round trip."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configuration","__idx":2},"children":["Configuration"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"table"},"children":[{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Keys"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Expression that yields an array of key names to remove (placeholder ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[]"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Clear all"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Removes all data saved in the SDK for this app. Clear all cannot be undone."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Journey event data"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This step can be configured to record step input and output data, or a custom payload, which is then surfaced in journey events in Journey Analytics for diagnostic purposes. For details, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/getting-started/event_reporting"},"children":["Additional data reporting"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example","__idx":3},"children":["Example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this step when stored client data should no longer be returned on the next journey call—for example, after logout."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If a login journey saved a session identifier and a user email with ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/orchestration/journeys/store_data_on_sdk"},"children":["Save Data in SDK"]},", a logout journey can delete only the session key and leave the email in place for the next login:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"[\"session_id\"]\n"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the next journey invocation, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@policy.sdkSavedData().session_id"]}," is no longer available, while ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@policy.sdkSavedData().userEmail"]}," still is."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To drop every stored key for the app, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Clear all"]}," instead."]}]},"headings":[{"value":"Delete Data from SDK","id":"delete-data-from-sdk","depth":1},{"value":"Description","id":"description","depth":2},{"value":"Configuration","id":"configuration","depth":2},{"value":"Example","id":"example","depth":2}],"frontmatter":{"markdown":{"toc":{"depth":2}},"seo":{"title":"Delete Data from SDK"}},"lastModified":"2026-10-22T11:50:57.422Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/orchestration/journeys/delete_data_from_sdk","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}