@kiina/user-session
v1.1.3
Published
This package manipulates all user session data in firebase realtime database.
Downloads
2
Keywords
Readme
user-info
This package manipulates all user session data in firebase realtime database.
Attention
For projects what use node version 8 use package version 1.1.0
Installation
npm install @kiina/user-session
Usage
const config = {
client: '{client_name}',
apiKey: '{firebase_token}',
authDomain: '{firebase_auth_domain}',
databaseURL: '{firebase_databse_url}',
projectId: '{firebase_project_id}',
storageBucket: '{firebase_storage_bucket}',
messagingSenderId: '{messenger_sender_id}',
rootNode: '{root_node}'
}
const UserInfo = require('@kiina/user-session');
var userInfo = new UserInfo(config);
//retrieves data from '{rootNode}/{user_id}/{attribute_name}'
session = await userInfo.getKey(123, 'name');
//saves user data in '{rootNode}/{user_id}/{attribute_name}'
await userInfo.setKey(132, 'user-data', {first_name: 'João', last_name: 'Carlos'});