2.0.12 • Published 2 years ago

healthgyro-sdk v2.0.12

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

2 years ago

2.0.8

2 years ago

2.0.11

2 years ago

2.0.12

2 years ago

2.0.10

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

1.7.10

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.7.9

2 years ago

1.7.8

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.7.3

2 years ago

1.6.4

2 years ago

1.7.2

2 years ago

1.6.3

2 years ago

1.7.1

2 years ago

1.6.2

2 years ago

1.0.8

2 years ago

1.7.0

2 years ago

1.6.1

2 years ago

1.5.2

2 years ago

1.4.3

2 years ago

1.6.0

2 years ago

1.5.1

2 years ago

1.4.2

2 years ago

1.2.4

2 years ago

1.5.0

2 years ago

1.4.1

2 years ago

1.2.3

2 years ago

1.4.0

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.6.9

2 years ago

1.7.7

2 years ago

1.6.11

2 years ago

1.6.8

2 years ago

1.7.6

2 years ago

1.6.10

2 years ago

1.6.7

2 years ago

1.7.5

2 years ago

1.6.13

2 years ago

1.6.6

2 years ago

1.7.4

2 years ago

1.6.5

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago