Server code is returning undefined to client code

I am a little stuck trying to get a token from the server code to the client. In my server code my call works and a token is returned as var clientToken . The problem is that when I return the response I am getting undefined on my client side.

I am thinking it is because the return token is happening before the response is returned but I am having trouble fixing it. Any help is greatly appreciated.
server code:


  var token = gateway.clientToken.generate({}, function (err, response) {
     var clientToken = response.clientToken
     console.log("token", clientToken);
      return clientToken
     return token


client code:'client.token.braintree', {customer_id:
   this.props.customer_id}, (err,res) => {
     if(!err) {
       console.log("tokens client side", res)


Check about Promises or async/await