Skip to main content

Clinik Client

The Clinik class is the entry point for all SDK operations. It manages authentication, retries, rate limit metadata, and request serialization.

Constructor

Parameters

ClinikOptions

Resource Namespaces

The client exposes 62 resource namespaces, organized by FHIR domain:
Each namespace provides:

FHIR Escape Hatch

For raw FHIR R4 requests:
See FHIR Passthrough for details.

Response Type

Every method returns ApiResponse<T>:

Security Features

The SDK includes built-in security protections:
  • Browser detection — warns if used in a browser environment
  • HTTPS enforcement — warns if baseUrl is not HTTPS
  • Path traversal protection — resource IDs are validated against [a-zA-Z0-9\-_.]
  • FHIR include injection prevention_include values are validated
  • Body size limits — requests over 1MB are rejected before sending
  • PHI sanitization — error messages never contain patient data
  • Jittered retries — prevents thundering herd on failures