An access token allows you to make API calls to a connected third-party service on behalf of a user. WorkOS handles token refresh automatically, so you always receive a valid, non-expired token.
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', });
POST/data-integrations /:slug /tokenParameters Returns