added client-side example code snippet