I am not sure what you are doing but if you want to call an API when the user is not present by retrieving authorized tokens from a database for instance, you need to use a sub-class to override the token storage methods.
You could set the variables manually but if your API uses refresh tokens, the new tokens need to be updated in storage.
Therefore this package provides a generic database storage class that you can extend and adapt to the way your application stores the tokens in a database with SQL queries.
In this article you can learn how to use the mysqli_oauth_client_class to store tokens in a MySQL database table using MySQLi.
phpclasses.org/blog/package/7700/po
...