Testing autotask with relayer locally

I've followed the example in the docs how to develop autotask locally
but when running node task.js it failes with Failed to get a token for the API key <apikey>: User does not exist.

Is it possible at all to run autotasks locally with the relayers?
Secondly no where in the example or code do we choose a relayer when running locally, how would that be done?
Thirdly the example code doesnt seem to be compatible when uploading the code to defender as in the example the event is {apikey,apisecret} while in defender we have to pass to the relayer event.credentials

Hello! Can you provide an example of your code?