How to customize the updating of my plugin on my own site?

I want to put my plugin on my site. When checked a newer version for users, users can click a button to download and update the plugin. Is there any example code for it? I searched online for a while but found nothing.

You’d have to perform the download yourself; Class: Sketchup::Http::Request — SketchUp Ruby API Documentation
Assuming it’s distributed via RBZ you can use Sketchup.install_from_archive: Module: Sketchup — SketchUp Ruby API Documentation

There is much discussion on this subject:

https://forums.sketchup.com/search?q=Http::Request