Getting HDPrivateKeys Sample

I have been trying to get this sample working in client side/browser (Chrome) to work -

But have been unable to do so

var hdPrivateKey = new bitcore.HDPrivateKey();
var retrieved = new bitcore.HDPrivateKey(‘xprv9s21ZrQH143K4EQh…’);
var derived = bitcore.PrivateKey.derive(“m/0’”);

However, I am getting the error “uncaught TypeError: undefined is not a function” when trying to “derive” the bip32 keys. Any ideas?

Thank you

Here’s a working browser example for HD keys!