Adding a billing section in the member section

I wrote a different code to make it appear at the place I want

<script type="text/discourse-plugin" version="0.8">
    api.onPageChange(() =>{
        addNav();
    });
    function addNav(){
        if($('.affiliation-link').length){
            // do nothing 
        } else {
            li = '<li class="no-glyph nav-interface affiliation-link"><a href="https://lepeuplier.memberful.com/account">Facturation</a></li>';
            $(".user-preferences-page .preferences-nav").append(li);
        }
    }

</script>