In the following line: https://github.com/octoblu/meshblu-core-task-create-session-token/blob/73218c59f972859442e8e96df66e783a17069d86/src/create-session-token.coffee#L28 there should be passed as argument `response` instead of `metadata`.