Setup

After installing the addon, you'll need to setup the database on application start. For this, you should add the following to your application/route.js:

// application/route.js or routes/application.js
import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default class ApplicationRoute extends Route {
 @service indexedDb;

 beforeModel() {
   this._super(...arguments);

   return this.indexedDb.setupTask.perform();
 }
}

This returns a promise that is ready once the database is setup. Note that this will reject if IndexedDB is not available - you need to handle this case accordingly.

Now, you just need to define your database tables by extending the indexed-db-configuration service.