The component is automatically hidden until authentication is provided. Once you set
accessToken or authConfig, it becomes visible.If you’re using proxying (
socketUrl or socketProxy), authentication is handled by your proxy — accessToken and authConfig are ignored.Using accessToken
Set it as an HTML attribute or JavaScript property. You must update it manually before it expires:
authConfig with automatic refresh.
Using authConfig (recommended)
Use authConfig when you want to supply token metadata and (optionally) enable automatic refresh. If you provide a refreshAccessToken callback, the component calls it automatically when the token is about to expire:
| Field | Type | Required | Description |
|---|---|---|---|
accessToken | string | No | Initial access token. If omitted, the component can only obtain a token if you also provide refreshAccessToken. |
expiresIn | number | No | Token lifetime in seconds. Used to schedule the next refresh. |
refreshToken | string | No | Refresh token passed to refreshAccessToken when a refresh is needed (if you provide the callback). |
refreshAccessToken | ({ refreshToken }) => Promise | No | Optional callback for automatic refresh. Returns { accessToken, expiresIn?, refreshToken? }. Without it, you must update accessToken yourself before expiry. |
How token refresh works
Under the hood, Dictation Web Component uses Corti JavaScript SDK to connect. See How token refresh works for the full behavior.-
Initial token — If
accessTokenis provided inauthConfig, it’s used immediately. Otherwise,refreshAccessTokenis called withundefinedto obtain the first token. -
Automatic refresh — The component monitors the token’s expiration and calls
refreshAccessTokenbefore it expires. TherefreshTokenparameter will be:undefinedon the first call (if no initialrefreshTokenwas provided)- The
refreshTokenreturned from the previous refresh call
- Seamless operation — Refresh happens in the background. Active dictation sessions continue without interruption.
Using with modular components
When using individual components, setauthConfig on <dictation-root>:
See also
- API Reference — full property tables for all components
- Proxy Guide — route traffic through your own server (auth handled by proxy)
- Examples — token refresh example