Skip to content

Commit c3fdaf7

Browse files
authored
chore(docs): add updateToken method and update externally obtained token (#311)
1 parent 46ae709 commit c3fdaf7

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

docs/authentication.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ const sdk = new UiPath({
4343
});
4444
```
4545

46+
!!! info "Using externally obtained tokens"
47+
If you have backend / external system that handles authentication and token generation, you can pass the token directly to the SDK via the `secret` parameter at initialization. When the token expires, your backend / external system can inject a refreshed token into the same instance via `sdk.updateToken()` to keep it authenticated. In this setup, token lifecycle management stays entirely on your side.
48+
4649
To Generate a PAT Token:
4750

4851
1. Log in to [UiPath Cloud](https://cloud.uipath.com)
@@ -141,14 +144,15 @@ useEffect(() => {
141144
}, []);
142145
```
143146

144-
### Available OAuth Methods
147+
### Available Auth Methods
145148
- `sdk.initialize()` - Start OAuth flow (auto completes also based on callback state)
146149
- `sdk.isInitialized()` - Check if SDK initialization completed
147150
- `sdk.isAuthenticated()` - Check if user has valid token
148151
- `sdk.isInOAuthCallback()` - Check if processing OAuth redirect
149152
- `sdk.completeOAuth()` - Manually complete OAuth (advanced use)
150153
- `sdk.getToken()` - Get the logged-in user's access token
151154
- `sdk.logout()` - Logout and clear all authentication state (requires re-initialization to authenticate again)
155+
- `sdk.updateToken()` - Inject a refreshed token into the SDK instance (useful for backend services managing token lifecycle)
152156

153157
---
154158

0 commit comments

Comments
 (0)