Add example code for v1 and v2.