@seald-io/sdk-plugin-localstorage
TypeScript icon, indicating that this package has built-in type declarations

0.13.0 • Public • Published

@seald-io/sdk-plugin-localstorage

This module is a plugin for the Seald SDK : @seald-io/sdk.

⚠️ This module is deprecated. You probably want to use a persistent database instead: see https://docs.seald.io/en/sdk/guides/4-identities.html#persistent-local-database.

The @seald-io/sdk-plugin-localstorage module allows to store the Seald identity in the browser's localStorage, encrypted by a localStorageKey.

For the localStorageKey, you can either use a user password, or a random string stored by your back-end and given after authentication.

This module exposes a function, that takes prefix as argument, and returns a SDKPlugin which can be passed to the SealdSDK constructor.

When the Seald SDK is passed this plugin, the SealdSDK instance is modified to have a localStorage property, which exposes the PluginLocalStorage interface.

Example:

import SealdSDK from '@seald-io/sdk-web'
import SealdSDKPluginLocalStorage from '@seald-io/sdk-plugin-localstorage'

const seald = SealdSDK({
  appId,
  plugins: [SealdSDKPluginLocalStorage()] // passing the plugin to SealdSDK
})
await seald.initialize()

// Creating a Seald identity
await seald.initiateIdentity({ userId, userLicenseToken })
// The SealdSDK instance now has a `localStorage` property : we can use `saveIdentity`
await seald.localStorage.saveIdentity({ userId, localStorageKey })

For more information, visit our website : https://seald.io

For the full documentation, visit our documentation page : https://docs.seald.io/en/sdk/

© 2021 Seald SAS

Readme

Keywords

none

Package Sidebar

Install

npm i @seald-io/sdk-plugin-localstorage

Weekly Downloads

0

Version

0.13.0

License

UNLICENSED

Unpacked Size

14.4 kB

Total Files

8

Last publish

Collaborators

  • arantes
  • seald
  • tex0l