
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@ehrocks/react-native-swag-ui-patterns
Advanced tools
Utilities for communication between mini apps or mini app and core EH app
@ehrocks/react-native-superapp-communicationUtilities for communication between mini apps or mini app and core EH app
Open a Terminal in your project's folder and run,
yarn add @ehrocks/react-native-superapp-communication
import { Identity } from '@ehrocks/react-native-superapp-communication';
// Listen to login event
const removeLoginListener = Identity.addLoginListener((token) => {
console.log({ token });
});
// Dispatch login event
Identity.dispatchLoginEvent('token');
// Remove login listener
removeLoginListener();
import { Identity } from '@ehrocks/react-native-superapp-communication';
// Listen to token changed event
const removeTokenChangedListener = Identity.addTokenChangedListener((token) => {
console.log({ token });
});
// Dispatch token changed event
Identity.dispatchTokenChangedEvent('token');
// Remove the listener
removeTokenChangedListener();
import { Identity } from '@ehrocks/react-native-superapp-communication';
// Listen to logout event
const removeLogoutListener = Identity.addLogoutListener(() => {
console.log('Receive Logout event');
});
// Dispatch logout event
Identity.dispatchLogoutEvent({});
// Remove logout listener
removeLogoutListener();
import { NotificationEvent } from '@ehrocks/react-native-superapp-communication';
// Listen to open notification event
const removeOpenNotificationListener = NotificationEvent.addOpenNotificationListener((payload) => {
console.log(payload);
});
// Dispatch open notification event
const payload = {
type: 'notification_type',
organisation_id: '1234',
meta: {
appName: 'swagApp'
}
}
NotificationEvent.dispatchOpenNotificationEvent(payload);
// Remove open notification listener
removeOpenNotificationListener()
import { DeepLinkEvent } from '@ehrocks/react-native-superapp-communication';
// Listen to open deep link event
const removeOpenDeelinkListener = DeepLinkEvent.addOpenDeepLinkListener((payload) => {
console.log(payload);
});
// Dispatch open deep link event
const payload = {
url: 'employmenthero://test',
}
DeepLinkEvent.dispatchOpenDeepLinkEvent(payload);
// Remove open deeplink listener
removeOpenDeeplinkListener();
FAQs
Utilities for communication between mini apps or mini app and core EH app
We found that @ehrocks/react-native-swag-ui-patterns demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.