Skip to main content

Which Package Do I Use?

This guide helps you choose the right package when multiple options exist for similar functionality.

Core vs. Axios Packages

The SDK uses a layered architecture: -core packages contain HTTP-client-agnostic logic, and -axios packages wire them up with axios. Unless you have a specific reason to use a -core package, always use the -axios variant.

NeedUse ThisNot This
Make API calls to Availity services@availity/api-axios@availity/api-core
Log client-side errors@availity/exceptions-axios@availity/exceptions-core
Check user permissions@availity/authorizations-axios@availity/authorizations-core
Download files@availity/dl-axios@availity/dl-core

When to use a -core package

Only use -core packages if you:

  • Need to use a different HTTP client (e.g., fetch, a custom wrapper, or testing with mocks)
  • Are building a framework-level integration that needs to remain HTTP-client-agnostic
  • Need to extend the base class with custom behavior before wiring up the HTTP layer

AvApi vs. AvMicroserviceApi

Both are in @availity/api-axios. The difference is the URL structure and default behaviors:

AvApiAvMicroserviceApi
Base path/api/ms/api/availity/internal
Default version/v1(none)
URL pattern/api/v1/{name}/ms/api/availity/internal/{name}
CachingEnabled by defaultDisabled by default
PollingEnabled (handles 202s)Disabled
Polling methodGETPOST
Use forPlatform APIs (permissions, orgs, regions, users)Internal microservices (files, webQL, custom services)

Which should I extend?

import AvApi, { AvMicroserviceApi } from '@availity/api-axios';

// Extend AvApi for platform REST APIs
class MyPlatformApi extends AvApi {
constructor() {
super({ name: 'my-resource' }); // => /api/v1/my-resource
}
}

// Extend AvMicroserviceApi for internal microservices
class MyInternalApi extends AvMicroserviceApi {
constructor() {
super({ name: 'my-service' }); // => /ms/api/availity/internal/my-service
}
}

File Handling: Upload vs. Download vs. Files

NeedPackageDescription
Upload files to the vault@availity/upload-coreResumable uploads via tus protocol, virus scanning, progress tracking
Download files to the browser@availity/dl-axiosFetch binary data and trigger browser download dialog
Manage file metadataAvFilesApi (from @availity/api-axios)List, query, and get download URLs for uploaded files
Deliver files to payersAvFilesDeliveryApi (from @availity/api-axios)Submit files for delivery to payer systems

Typical flow: Upload with upload-core → manage with AvFilesApi → deliver with AvFilesDeliveryApi.

Environment & URL Utilities

NeedPackage
Get different values per environment (test/qa/prod)@availity/env-var
Resolve relative URLs to absolute@availity/resolve-url

SSO & Navigation

NeedPackage
Navigate to a payer portal via SSO (SAML/OpenID)@availity/native-form
Keep session alive in portal iframe@availity/user-activity-broadcaster

Validation & Documentation

NeedPackage
Define validation schemasyup (with @availity/yup extensions)
Convert yup schemas to human-readable docs@availity/dockyard

Error Handling & Logging

NeedPackage
Automatic error capture + logging to Availity@availity/exceptions-axios
Custom error logging transport@availity/exceptions-core
Analytics event tracking@availity/analytics-core

Decision Flowchart

Do you need to call an Availity API?
├── Yes → Is it a platform API (/api/v1/...)?
│ ├── Yes → Use AvApi or a pre-built resource from api-axios
│ └── No → Use AvMicroserviceApi
└── No → See specific utility packages above

Do you need the -core or -axios variant?
├── Using axios (default) → Use -axios
└── Custom HTTP client → Use -core