Unable to capture error

Hi Guys,
Im trying to use context.serverlessSdk.captureError(error) for capturing errors but context doesn’t contain a property called serverlessSdk And therefore getting an error “TypeError: Cannot read property ‘captureError’ of undefined”.

https://www.serverless.com/framework/docs/dashboard/sdk/nodejs/#captureerror

Can someone help me out please