Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

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/datastore';
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/datastore';
await DataStore.start();

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