Update index.js

Patch for client-side usage.