# Delete Local Session Data

Delete all local user data that was collected during onboarding from the device by calling `deleteUserLocalData()`.&#x20;
Use this method after onboarding completes to clear session data on the device, or when complying with data retention requirements.

## When to call `deleteUserLocalData()`

### End-to-end flows (`startOnboarding()`, `startFlow()`, `startWorkflow()`)

Call `deleteUserLocalData()` in the success or error callback of the final flow/section call, after the user has finished or abandoned the flow.

### Section-based flows (`startOnboardingSection()`)

Do not call `deleteUserLocalData()` before `finishOnboarding()` or between sections. Calling it too early prevents the onboarding session from completing. Call it only after `finishOnboarding()` succeeds.

### Example

```javascript
cordova.exec(
  function () { console.log("Local data deleted"); },
  function (err) { console.log("deleteUserLocalData error:", err); },
  "Cplugin",
  "deleteUserLocalData",
  []
);
```

There is no structured result payload, only success/failure via the standard Cordova callbacks. The success callback confirms deletion completed; the error callback fires if deletion fails.&#x20;

<br />
