@arcblock/did-auth-storage-firebase
v1.7.1
Published
Storage engine that uses firebase for did-auth
Downloads
100
Readme
@arcblock/did-auth-storage-firebase
Storage engine that uses firebase to store data, implements interfaces defined in
@arcblock/did-auth-storage
.
Table of Contents
Install
npm install @arcblock/did-auth-storage-firebase firebase-admin
// or
yarn add @arcblock/did-auth-storage-firebase firebase-admin
Usage
const { Handlers, Authenticator } = require('@arcblock/did-auth');
const FirebaseStorage = require('@arcblock/did-auth-storage-firebase');
const firebase = require('firebase-admin');
const connection = firebase.initializeApp({
credential: firebase.credential.cert('path/to/serviceAccountCredentials.json'),
databaseURL: 'https://databaseName.firebaseio.com',
});
const storage = new FirebaseStorage({
database: connection.database(),
tokens: 'did_auth_tokens',
})
(async () => {
const token = '123456';
const item = await storage.create(token);
})();
Contributors
| Name | Website | | -------------- | -------------------------- | | wangshijun | https://ocap.arcblock.io |