VSee Clinic Flutter Demo: Video Consultation
A proof-of-concept Flutter app that shows a complete VSee Clinic integration for patient video visits. It runs the whole flow, from patient sign-in to a live video call in the VSee Browser SDK.
Download
Get the demo app source from Google Drive.
Features
- SSO authentication: signs the patient in through the VSee API and gets both an API access token and VSee credentials.
- Intake creation: creates the patient's intake record and links the patient to a waiting room.
- Walk-in visit creation: creates a visit to join right away and gets the meeting (conference room) ID.
- Video call in the Browser SDK: embeds the VSee Browser SDK in a WebView, with full audio, video and chat. It works with VSee Messenger clients.
Project structure
vc-flutter-demo/
├── lib/
│ ├── config/
│ │ └── vsee_config.dart # API credentials & configuration
│ ├── models/
│ │ └── vsee_models.dart # Data models (SSO, Intake, Visit)
│ ├── services/
│ │ └── vsee_api_service.dart # API service layer
│ ├── pages/
│ │ ├── home_page.dart # Main UI with flow orchestration
│ │ └── video_call_page.dart # WebView-based video call page
│ └── main.dart # App entry point
├── android/
├── ios/
├── web/
├── pubspec.yaml
└── setup.sh
Technologies used
- Flutter: cross-platform mobile framework
- http: HTTP client for the API calls
- webview_flutter: WebView plugin that hosts the Browser SDK
- VSee Browser SDK: Jitsi-based video calling SDK
Quick start
- Install Flutter if you don't have it: https://flutter.dev/docs/get-started/install.
- Set up the project:
cd /path/to/vc-flutter-demo flutter pub get - Run it:
flutter run -d ios # iOS (macOS only) flutter run -d android # Android flutter run -d chrome # Web (experimental) - Tap Start Video Call and watch the progress: SSO → intake → visit → the video call launches.
Platform support
| Platform | Status | Notes |
|---|---|---|
| iOS | Supported | Requires iOS 12.0 or later |
| Android | Supported | Requires Android 5.0 or later (API 21+) |
| Web | Experimental | WebView limitations apply |
| macOS | Untested | Should work with minor configuration |
Credentials (staging only)
Credentials are set in lib/config/vsee_config.dart. Use the API key and secret from your staging clinic; see Sign Up for a Developer Account.
// Use the API key and secret from your developer account:
// https://developers.vsee.com/guides/getting-started/developer-account
Integration flow
API flow
Patient App
│
├─► Step 1: POST /users/sso?fields=vsee
│ └─► Returns: {sso_token, vsee_token, user_id, vsee_id}
│
├─► Step 2: POST /intakes (with sso_token)
│ └─► Returns: {intake_id}
│
├─► Step 3: POST /visits/add_walkin (with sso_token, intake_id)
│ └─► Returns: {visit_id, meeting_id}
│
└─► Step 4: Launch WebView with Browser SDK
└─► Uses: vsee_token + meeting_id → Joins video conference
The same flow runs step by step, with live requests, in the Video Session use case.
Step 1: SSO authentication
Endpoint: POST /users/sso?fields=vsee
Signs the patient in and returns the credentials for API calls and video calling.
Request:
# Use the API key and secret from your developer account:
# https://developers.vsee.com/guides/getting-started/developer-account
curl --location 'https://api.vseepreview.com/vc/stable/api_v3/users/sso?fields=vsee' \
--header 'X-AccountCode: sandbox' \
--header 'X-ApiKey: YOUR_API_KEY' \
--header 'X-ApiSecret: YOUR_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"first_name": "YOUR_FIRST_NAME",
"last_name": "YOUR_LAST_NAME",
"type": 200,
"email": "YOUR_EMAIL",
"code": "YOUR_UNIQUE_CODE"
}'
Key response fields:
| Field | Description |
|---|---|
data.id | The patient's user ID |
data.token.token | SSO token for API calls |
data.vsee.id | VSee username for the Browser SDK |
data.vsee.token | VSee auth token for the Browser SDK |
Implementation: VSeeApiService.performSSO() in lib/services/vsee_api_service.dart. See the User API for the full endpoint reference.
Step 2: Create an intake
Endpoint: POST /intakes
Creates an intake record that links the patient to a waiting room.
Headers: X-ApiToken: <sso_token_from_step1>
Request body:
{
"waiting_room_id": 1
}
Key response field: data.id, the intake UUID (for example "61165a8e-d8cc-47da-bd8e-597d64457b1f").
Implementation: VSeeApiService.createIntake() in lib/services/vsee_api_service.dart
Step 3: Create a walk-in visit
Endpoint: POST /visits/add_walkin
Creates a visit the patient can join immediately.
Headers: X-ApiToken: <sso_token_from_step1>
Request body:
{
"intake_id": "61165a8e-d8cc-47da-bd8e-597d64457b1f"
}
Key response fields:
| Field | Description |
|---|---|
data.id | Visit ID (for example "67258") |
data.meeting.meeting_id | Conference room identifier for the Browser SDK |
Implementation: VSeeApiService.createWalkinVisit() in lib/services/vsee_api_service.dart. See the Visit API for the full endpoint reference.
Step 4: Launch the video call
The call runs in the VSee Browser SDK, which is based on Jitsi Meet. It needs the meeting ID (step 3), the VSee auth token (step 1), and the patient's display name and email.
- Load the external API script:
<script src='https://clinic.meet.vsee.com/libs/external_api.min.js'></script> - Initialize the SDK:
const domain = 'clinic.meet.vsee.com'; const options = { roomName: 'MEETING_ID_FROM_STEP_3', width: '100%', height: '100vh', parentNode: document.querySelector('#vsee-container'), jwt: 'VSEE_AUTH_TOKEN_FROM_STEP_1', userInfo: { displayName: 'Patient Name', email: 'patient@example.com' }, configOverwrite: { startWithAudioMuted: false, startWithVideoMuted: false, prejoinPageEnabled: false } }; const api = new JitsiMeetExternalAPI(domain, options); - Listen to events:
api.addEventListener('videoConferenceJoined', () => { console.log('Conference joined'); }); api.addEventListener('videoConferenceLeft', () => { console.log('Conference left'); });
Implementation: VideoCallPage in lib/pages/video_call_page.dart. See Browser Call SDK for more on the SDK.
Testing
Scenario 1: solo test
- Run the app and tap Start Video Call.
- Check that every step completes (SSO → intake → visit).
- The video call loads. It may show "waiting for others".
Scenario 2: two-party test (patient and provider)
- Patient side: run this Flutter app.
- Provider side: use VSee Messenger (desktop or mobile), or the Browser SDK JSFiddle with provider credentials and the same meeting ID.
Troubleshooting
Authentication
"SSO failed: 401"
- Check the API credentials (account code, API key, API secret) in
vsee_config.dart. - Check that the API endpoint URL is correct.
"Create intake failed: 400"
- Check that the
waiting_room_idexists and is accessible. - Check that the SSO token is still valid.
"Create visit failed: 400"
- Check that the
intake_idis valid. - Make sure the intake hasn't already been used for another visit.
Flutter setup
"Flutter command not found"
- Install the Flutter SDK and add it to your PATH: https://flutter.dev/docs/get-started/install.
"WebView not loading"
- Check internet connectivity.
- Check the permissions in
Info.plist(iOS) orAndroidManifest.xml(Android).
Video call
The video call doesn't load
- Check network connectivity.
- Check that the Browser SDK script URL is reachable (
https://clinic.meet.vsee.com/libs/external_api.min.js). - Look for JavaScript errors in the browser console.
- Make sure camera and microphone permissions are granted.
Black screen in the video call
- Make sure camera and microphone permissions are granted, not just requested.
- Check that the device has a working camera.
- Try another video calling app to rule out a hardware problem.
The provider doesn't see the visit
- Check that
waiting_room_idis correct and the provider has access to that room. - Make sure the visit was created (check
visit_idin the logs). - Confirm the patient and provider are using the same waiting room.
Security
Warning: This is a proof-of-concept demo app. The credentials it uses are for the sandbox only and must never be used in production.
For production deployments
- Never hard-code API credentials. Use environment variables or a secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.).
- Use a backend proxy. Send all API calls through your server, never directly from the client.
- Refresh tokens. SSO tokens expire, so add refresh logic for long sessions.
- Check permissions. Request camera and microphone permissions before launching the video call.
- Use HTTPS only. All API calls and WebView content must use HTTPS.
- Separate credentials per environment. Use distinct credentials for development, staging and production.
Files to keep out of version control
These are generated and should not be committed (they are already in .gitignore):
android/local.propertiesios/Pods/andmacos/Pods/.dart_tool/build/
For a clean distribution archive, run ./archive.sh. It removes build artifacts, local configuration and IDE files.
Resources
- Embedding the waiting room: Patient Side Integration
- Browser Call SDK
- Browser SDK JSFiddle example
- Jitsi Meet IFrame API
- Flutter documentation
Versions: Flutter 3.0.0 or later · VSee API v3 (stable) · Browser SDK beta.