Implement persistance Increment of a value

I have a static HTML website. It has a feature where there is a form to be filled and once submitted a copy of the form is sent to the user by email. I used EmailJS for the functionality. That works fine.

However for each form I have an id and I want it to be auto-incremented for every copy sent. I don’t want to use localstorage because when the cache is cleared it gets removed. I need a permanent solution for incrementing the id for each invoice sent.

When a user fills the form the id must be a incremented value from the previous form.

I have no idea how to do this. I implemented a NodeJs server that too when refreshed goes to initial state.