What’s the cleanest way to generate a long-lived API token for a CI/CD pipeline using the Genesys Cloud JS SDK? I’m trying to avoid hardcoding credentials in the build server, but the standard OAuth2 client credentials flow feels heavy for a simple token refresh step.
I tried calling postOAuth2Token with grant_type: 'client_credentials', but the token expires in 15 minutes. The docs mention long-lived tokens, but the SDK methods don’t seem to expose a specific flag or endpoint for that. Here’s what I’m sending:
const result = await client.auth.postOAuth2Token({
grant_type: 'client_credentials',
client_id: process.env.GC_CLIENT_ID,
client_secret: process.env.GC_CLIENT_SECRET
});
Any ideas on how to extend the lifetime or if I’m missing a specific SDK method?