Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 871 Bytes

COLLISION.md

File metadata and controls

23 lines (16 loc) · 871 Bytes

Collision guide

All client-side storages (both indexedDB and localStorage) are restricted to the same subdomain, so there is no risk of collision in most cases. Only if you have multiple apps on the same subdomain and you do not want to share data between them, you need to add a prefix.

Configuration

For example:

import { provideLocalStoragePrefix, provideIndexedDBDataBaseName } from '@ngx-pwa/local-storage';

bootstrapApplication(AppComponent, {
  providers: [
    provideLocalStoragePrefix('myapp_'), // prefix when in `localStorage` fallback
    provideIndexedDBDataBaseName('myAppStorage'), // custom database name when in `indexedDB`
  ]
});

Caution

Never change these options in an app already deployed in production, as all previously stored data would be lost.

Back to general documentation