@ramses-superapp/host-services-contract
v0.1.6
Published
A Lightweight NPM package to ease host-services injection into MiniApps from SuperApp for Ramses Built MiniApps
Readme
@ramses-superapp/host-services-contract
A Lightweight NPM pacakge to ease host services injection into MiniApps from SuperApp for Ramses Built MiniApps
Installation
npm install @ramses-superapp/host-services-contract
#or
yarn add @ramses-superapp/host-services-contract
Usage
import { useHostServices } from '@ramses-superapp/host-services-contract';
// ...
const { auth, eventBus } = useHostServices();
const handleLogin = async () => {
// ...
await auth.storeTokens(
'OnBoarding',
'access-token-from-api',
'refresh-token-from-api'
);
await auth.storeUserId('OnBoarding', '123');
eventBus.emitFromRemote('OnBoarding', 'auth:login_success', {
userId: '123',
});
};License
MIT
Made with create-react-native-library
