Pipes provides OAuth integrations with third-party providers that allow your users to securely connect their accounts to your application. Pipes handles the complete OAuth lifecycle including token refresh and credential storage.
Read more in the Pipes guide.
Fetches a valid OAuth access token for a user’s connected account. WorkOS automatically handles token refresh, ensuring you always receive a valid, non-expired token.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const token = await workos.pipes.getAccessToken({ userId: 'user_01EHZNVPK3SFK441A1RGBFSHRT', organizationId: 'org_01EHZNVPK3SFK441A1RGBFSHRT', provider: 'github', });
pipes .getAccessToken()Parameters objectReturns