if (!SuperSDK.isInApp()) {
console.log('Open this page in the app');
// Get environment information
const env = await SuperSDK.getEnv();
console.log('Current WebView ID:', env.webviewId);
console.log('App version:', env.versionName);
console.error('Could not read environment information:', error);
SuperSDK.onForeground((data) => {
console.log('Page active');
SuperSDK.onBackground((data) => {
console.log('Page entered background');
// Listen to broadcast messages
SuperSDK.subscribe('user_logout', () => {
function shareToFriends() {
SuperSDK.share('Try this app');
function openDetail(id) {
SuperSDK.openPage(`https://example.com/detail/${id}`);
// Close the page after completion.
// Notify other pages to refresh
SuperSDK.publish('order_created', { orderId: '12345' });