I'am trying to use the sync function but I always got undefined as my return value.
While debugging I eventually saw that the returned object of the getData function does not match the expected AxiosResponse type but is actually the REST API response as defined in the documentation https://www.contentstack.com/docs/developers/apis/content-delivery-api#initial-sync
So, response.data is always undefined which also leads to a type error while evaluating the while statement when setting the recursive parameter to true
Uncaught TypeError: Cannot use 'in' operator to search for 'pagination_token' in undefined

I'am trying to use the sync function but I always got
undefinedas my return value.While debugging I eventually saw that the returned object of the getData function does not match the expected AxiosResponse type but is actually the REST API response as defined in the documentation https://www.contentstack.com/docs/developers/apis/content-delivery-api#initial-sync
So,
response.datais alwaysundefinedwhich also leads to a type error while evaluating the while statement when setting therecursiveparameter totrue