Using and configuring IonicStoreage for Standalone (2025)

Hi, I am in the process of updating my Ionic / Angular application to standalone.

I have Angular v20.1.4, Ionic v8.7.1

I see some older post on setting up Ionic storage, and also at GitHub - ionic-team/ionic-storage: Ionic Storage module for Ionic apps I don’t see any mention of how to import for standalone.

Do I assume we still import the module, as following (e.g. in app.config.ts) but inside of importProvidersFrom..

providers: [
  importProvidersFrom(      
      IonicStorageModule.forRoot()
    ),
]

Thanks in advance

I use the below in main.ts

import { provideIonicAngular } from '@ionic/angular/standalone';

.....
bootstrapApplication(AppComponent, {
   providers: [
      ...provideIonicStorage(storageConfig),
   ]
})

and the storageConfig in a separate file storage-config.ts

import { StorageConfig } from '@ionic/storage-angular';
import { Drivers } from '@ionic/storage';
import * as CordovaSQLiteDriver from 'localforage-cordovasqlitedriver';

export const storageConfig: StorageConfig = {
   name: '<NAME>',
   driverOrder: [CordovaSQLiteDriver._driver, Drivers.IndexedDB, Drivers.LocalStorage],

};
1 Like

Thankyou! I’ll have a look at this.