How to automatically obtain and forward historical data from tags with custom storage module history enabled

I am new to Ignition SDK custom module development. I need to write a module to store and forward historical data in a specified database. How can I automatically obtain the historical data of a tag for forwarding storage after history is enabled in the tag? Which interface can I use to obtain the tag data for forwarding storage? I am using Ignition 8.1.43.