Updated plugin to use the DIrect API