Yes, you can use auth code flow to get tokens and refresh tokens, refresh tokens have a lifetime of 90 days, during which you can use refresh Tokens to exchange for new tokens without user interaction.
For more information about tokens you can see the documentation.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.