Look this one up. I used it before migrating to v2, but forgot about it It may be a good inspiration of what you’re trying to accomplish.
.