Gotcha that would have taken me forever to figure out lol.
Ok so I used your code but I’m trying to modify it to my situation.
my roles are based off pricing for my keg products so it looks like this
role1 = 130 //$130 keg
role2 = 150 //$150 keg
So when my 130 client logs in I only want him to see the 130 member page and hide the 150 member page

Since the menu holds the page values as an array , I tried to isolate the index for each and input them into your code but its not working not sure why.
line 28 and 29 show and hide doesn’t work for menu items(ln 16).
import { currentMember , authentication } from ‘wix-members’ ; //Import from currentMember API and Authentication API
$w . onReady (() => {
if ( authentication . loggedIn ()){ getRoles ();}
authentication . onLogin ( getRoles );
})
function getRoles ( ){
let menu = $w ( ‘#horizontalMenu2’ ). menuItems // Menu array
console . log ( menu );
let oneThirty = menu [ 3 ] //130 menu page selected in menu index
console . log ( ‘130’ );
console . log ( oneThirty );
let oneFifety = menu [ 4 ]; //150 menu page selected in menu index
console . log ( ‘150’ );
console . log ( oneFifety );
currentMember . getRoles ()
. then ( roles => { roles = roles . map ( e => e . title );
if ( roles . includes ( 130 )){
oneThirty . show (); // LN: 18 oneThirty menu index selected
oneFifety . hide (); // LN: 22 oneFiftey menu index selected
} else if ( roles . includes ( ‘Role B’ )){
$w ( ‘#element2’ ). show ();
$w ( ‘#element1’ ). hide ()
}
})
}