motion_planning_rviz_plugin is a plugin that lets you display joint paths on the robot in the rviz visualizer. It listens for topics of type motion_planning_msgs/DisplayPath and needs a joint path, a complete robot state and a model id for the particular robot you are trying to display.
The code API is mainly through a ROS interface. It is documented on the Wiki page for this package here. The topic name on which rviz listens for this message can be configured in rviz itself. Trajectories can be displayed in rviz by publishing messages on this topic using a message of type [[motion_planning_msgs/DisplayPlan.msg]].