Set Up Vitable Drops
Every Drop uses the same three-part setup: install the SDK, expose an authenticated backend endpoint that issues bound tokens, and configure VitableConnectProvider in your React application.
Before You Begin
- A Vitable API key stored on your backend. See Authentication.
- A Vitable employee or employer ID for the signed-in user.
- React 18 or later.
1. Install the SDK
2. Create a Server-Side Token Endpoint
Your backend must authenticate the caller, confirm that they may access the requested employee or employer, and exchange its API key for a bound access token.
The authorization check in this example is intentionally application-specific. Do not issue a token based only on an ID supplied by the browser. Confirm that the signed-in user may access that employee or employer, and apply appropriate CORS, CSRF, and rate-limit controls.
3. Configure the Provider
The provider calls your backend on mount and again when the token needs to be refreshed:
Use employee for the Employee Dashboard and employer for both employer widgets.
Provider Props
Token Lifecycle
The SDK fetches a token when the provider mounts, refreshes it before expiration, retries transient fetch failures with backoff, and sends updates to the iframe. Changing contextKey discards the existing session and requests a token for the new context.
Use a stable contextKey that matches the bound entity ID. Never reuse an employee-bound token for another employee or an employer-bound token for another employer.
4. Add a Widget
Continue with the component you need:
Production Checklist
- Authenticate every token request and authorize the requested entity.
- Keep the Vitable API key in server-side secret storage.
- Allow postMessage communication only with the expected Vitable origin.
- Reset
contextKeywhenever the active employee or employer changes. - Record token-fetch and widget errors without logging tokens.
Theming
Every Drop supports theming through the VitableConnectProvider. Pass a theme prop to customize colors, fonts, logo, and color mode so the embedded experience matches your application’s look and feel.
Theme Properties
The primaryColor value must be a key that exists in colors. For example, if primaryColor is "brand", there must be a colors.brand array. The logoUrl must use HTTPS.
Theme updates are applied in real time — if your app supports theme switching, the embedded widgets will update automatically when you change the theme prop.

