Getting Started

Installation & Setup

Open in Claude

Install the Vim Connect App SDK and set up your development environment

Prerequisites

Before you start building, make sure you have:

  • Node.js 18+ and a package manager (npm, yarn, or pnpm)
  • A Vim Connect developer account — contact your Vim representative to get one
  • A registered application — your app must be registered on the Vim Connect platform with an OAuth client ID and secret
  • The Vim Connect Chrome extension — install it from the Chrome Web Store (search "Vim Connect") or request access from your Vim representative
  • Access to a supported EHR — the extension must be running on an EHR page for the SDK to connect

Installation

npm install @vimconnect/app-sdk

The SDK requires zod as a peer dependency for runtime validation schemas:

npm install zod

Two shortcuts worth taking first

  • Don't want to start from an empty project? Fork the Demo App — a working Vim app with the OAuth flow and an explorer that drives every capability your manifest declares.
  • Building with an AI coding agent? Install the vim-app-sdk-docs skill — it ships inside @vimconnect/app-sdk and makes your agent look up real entity fields, event ids, and method signatures instead of guessing them.

How It Works

The @vimconnect/app-sdk package provides:

  1. initVimSDK() — Loads the core SDK from the Vim CDN and initializes a connection with the Chrome extension
  2. Typed wrappers — Full TypeScript types for entities, events, context keys, and API methods
  3. Zod schemas — Runtime validation schemas for all entity types (Patient, Encounter, Order, Referral)

Your application runs inside the Vim Hub sidebar, which is injected into the EHR by the Vim Connect Chrome extension. The SDK communicates with the extension via a MessageChannel to receive events, read data, and perform writeback operations.

Browser Tab (EHR)
├── Vim Connect Extension (content script)
│   ├── Detects the EHR system
│   ├── Extracts data using configured rules
│   └── Injects the Vim Hub (sidebar / overlay)
│       ├── App Hub (shows installed apps)
│       └── Your App (iframe)
│           └── @vimconnect/app-sdk
│               └── MessageChannel → Extension

The core SDK library is loaded at runtime from a CDN — it is not bundled into your application. This means:

  • Your bundle stays small
  • The core SDK can be updated independently
  • All apps on the platform share the same communication layer

Project Structure

A typical Vim app project looks like this:

my-vim-app/
├── src/
│   ├── app/
│   │   ├── launch/page.tsx      # OAuth launch redirect
│   │   ├── app/page.tsx         # Main app (SDK initialized here)
│   │   └── api/auth/token/
│   │       └── route.ts         # Server-side token exchange
│   ├── lib/
│   │   └── sdk-config.ts        # Environment-based config
│   └── components/              # Your UI components
├── .env.local                   # CLIENT_SECRET (server-only)
├── .env                         # NEXT_PUBLIC_* vars
├── package.json
└── next.config.js

Environment Variables

VariableWhereRequiredDescription
NEXT_PUBLIC_CLIENT_IDClient + ServerYesYour OAuth client ID from Vim Connect
CLIENT_SECRETServer onlyYesYour OAuth client secret (never expose to browser)
NEXT_PUBLIC_ENVClientYesWhich Vim backend to authenticate against. Use production — the credentials you create in the Console are production credentials. staging exists for Vim-internal work and needs access Vim grants you explicitly.
NEXT_PUBLIC_VIM_BACKEND_URLClientNoOverride the Vim backend URL (defaults based on NEXT_PUBLIC_ENV)
NEXT_PUBLIC_APP_URLClientNoOverride your app's URL (defaults to window.location.origin)

Next Steps

On this page