Hey @samielsolh,
Unfortunately, programmatically expanding the sidebar isn’t supported natively. There is an open feature request for this functionality here (as well as a few workarounds, such as this one shared by @marduk) which might work for you.
Please upvote this feature request if you’d like the team to prioritize it. Thank you!