It’s up to you, you can of course use code if it fits you better. You can see an example on how to use the function here:
Since we are still in beta, we can change the API if needed, but we will always announce it.
Note that for getItems the API was not changed, just enforced.