Using Plotly.animate() for 3D surface plot

I have code that plots a 3D surface plot in plotly.js and want to animate the plot as it changes when it updates. So far I’ve tried use the Plotly.animate() function as so to do this:

Plotly.animate('myDiv', {
    data: {z: [zPts], x: [xPts], y: [yPts]},
    traces: [0]
  }, {
    transition: {
      duration: 500,
      easing: 'cubic-in-out'
      frame: {
          duration: 500

I call this after I have updated the zPts, xPts, and yPts array to be the new surface I want to plot however the plot never changes. When I use Plotly.restlye() however it changes just fine which leads me to think I’m using Plotly.animate() incorrectly for a surface plot. Does anyone know the proper way to use the function for 3D surfaces? I’ve seen a post on here about animating a 3D scatter plot but that didn’t seem to work either.