Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Apr 29, 2024

Additional DataStore methods

Clear

To clear local data from DataStore, use the clear method:

import { DataStore } from 'aws-amplify';
await DataStore.clear();

If your app has authentication implemented, it is recommended to call DataStore.clear() on sign-in/sign-out to remove any user-specific data. This method is often important to use for shared device scenarios or where you need to purge the local on-device storage of records for security/privacy concerns.

Start

To manually start the sync process, use the start method:

import { DataStore } from 'aws-amplify';
await DataStore.start();

Synchronization starts automatically whenever you run any of the following methods: DataStore.query(), DataStore.save(), DataStore.delete(), or DataStore.observe().