Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Do I: Recreate or pass a refresh token to the @vonage/server-sdk instance of to any api call (ex: vonage.voice.createOutboundCall)? #974

Open
Satyam-code143 opened this issue Dec 13, 2024 · 2 comments
Assignees
Labels
question Question about how to use the SDK waiting-for-reporter Waiting for response from the reporter

Comments

@Satyam-code143
Copy link

Satyam-code143 commented Dec 13, 2024

How do I

recreate the instance/pass refresh token if the session expires. If I get 401 unauthorised or session expired error.

API/Product

Voice

Code Sample

I'm making an outgoing call utilising the @vonage/server-sdk. I have a server that runs around the clock, and as soon as the instance is started, calls are processed continuously. According to the documentation, Voice user JWT has a maximum expiration time of 24 hours and a minimum expiration time of 15 minutes (I am unable to see the issue for session expiry). In the event that the session ends, I would like to know how to recreate the instance or token. Additionally, you must be aware of where to handle the instance's dynamic creation or pass the token.

The code that I have referred is from the make-call.js

@Satyam-code143 Satyam-code143 added the question Question about how to use the SDK label Dec 13, 2024
@Satyam-code143
Copy link
Author

Hi @pardel @dragonmantank @manchuck ,

Any input on this?

@pardel pardel removed their assignment Dec 17, 2024
@manchuck
Copy link
Contributor

manchuck commented Jan 6, 2025

@Satyam-code143 Sorry for the delayed response (we were all on holiday). The SDK creates a JWT token for each request, so you do not need to worry about the tokens. Can you set the DEBUG=*vonage* environment variable and check the output in those logs to see what the response says?

Note Using that environment variable will output your vonage credentials, so be careful when sharing those logs

@manchuck manchuck added the waiting-for-reporter Waiting for response from the reporter label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about how to use the SDK waiting-for-reporter Waiting for response from the reporter
Projects
None yet
Development

No branches or pull requests

4 participants