A Lightweight NPM package to ease host-services injection into MiniApps from SuperApp for Ramses Built MiniApps
npm install @ramses-superapp/host-services-contractA Lightweight NPM pacakge to ease host services injection into MiniApps from SuperApp for Ramses Built MiniApps
``sh
npm install @ramses-superapp/host-services-contract
#or
yarn add @ramses-superapp/host-services-contract
`
`js
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',
});
};
``
MIT
---
Made with create-react-native-library