2.0.12 • Published 3 years ago
healthgyro-sdk v2.0.12
healthgyro-sdk
SDK for FE apps
Install
yarn add healthgyro-sdk@latest
Usage
Required setup
At the very root of your project, initialize as shown below;
import {initStrings, initVault, initAnalytics} from 'healthgyro-sdk';
import LocalizedStrings from 'react-native-localization'; // <- Or any other localization module
initStrings((data) => new LocalizedStrings(data));
initVault({
getRawAsync: async () => undefined,
getAsync: async () => undefined,
setAsync: async () => false,
hasAsync: async () => false,
removeAsync: async () => false,
removeAllAsync: async () => false,
extraKeys: {},
});
initAnalytics({
setUserId: async () => undefined,
setUserProperty: async () => undefined,
setAnalyticsCollectionEnabled: async () => undefined,
logEvent: async () => undefined,
logScreenView: async () => undefined,
logAppOpen: async () => undefined,
logLogin: async () => undefined,
logSignUp: async () => undefined,
});
Getting shared config file
import {getConfig} from 'healthgyro-sdk';
const environmentVariables = {};
const extraConfig = {
cacheTimeout: 150,
};
const config = getConfig(environmentVariables, extraConfig);
Creating app data store
import {createAppStore, Provider, PersistGate} from 'healthgyro-sdk';
import {additionalReducer} from './additional-reducer';
import storage from '@react-native-async-storage/async-storage'; // <- Or any other storage module
const {store, persistor} = createAppStore({
devTools: process.env.NODE_ENV !== 'production',
reducers: {
additionalReducer,
},
storage,
});
const App = () => (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<YourApp />
</PersistGate>
</Provider>
);
Docs
See docs here.
License
MIT © christiandrey
2.0.9
3 years ago
2.0.8
3 years ago
2.0.11
3 years ago
2.0.12
3 years ago
2.0.10
3 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.5
3 years ago
2.0.4
3 years ago
1.7.10
3 years ago
2.0.7
3 years ago
2.0.6
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.7.9
3 years ago
1.7.8
3 years ago
1.2.0
4 years ago
1.1.0
4 years ago
1.7.3
3 years ago
1.6.4
4 years ago
1.7.2
3 years ago
1.6.3
4 years ago
1.7.1
3 years ago
1.6.2
4 years ago
1.0.8
4 years ago
1.7.0
3 years ago
1.6.1
4 years ago
1.5.2
4 years ago
1.4.3
4 years ago
1.6.0
4 years ago
1.5.1
4 years ago
1.4.2
4 years ago
1.2.4
4 years ago
1.5.0
4 years ago
1.4.1
4 years ago
1.2.3
4 years ago
1.4.0
4 years ago
1.2.2
4 years ago
1.3.0
4 years ago
1.2.1
4 years ago
1.6.9
4 years ago
1.7.7
3 years ago
1.6.11
4 years ago
1.6.8
4 years ago
1.7.6
3 years ago
1.6.10
4 years ago
1.6.7
4 years ago
1.7.5
3 years ago
1.6.13
4 years ago
1.6.6
4 years ago
1.7.4
3 years ago
1.6.5
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago