Hello! As per the readme for the package, this code is meant to be run in a backend file. This will not work from your page code, hence your current “is not a function” error.
What error did you receive when testing in the backend?
Also, it appears you have pasted private information from the secrets manage in your screenshot. If this token is not meant to be public, please delete it to protect yourself.