Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@availity/api-axios
Advanced tools
A package wrapping axios to help fetch data inside the Availity Portal
If you are looking for the old docs you can find them here
@availity/api-core
is no longer required. It has been added to this packagelodash/merge
for merging configAvApi
constructoraxios
instead of a rangeasync/await
where applicablenpm install @availity/api-axios axios
yarn add @availity/api-axios axios
Check out more documentation at availity.github.io
This library exports several resources other than the AvApi
class. There are several available classes which extend AvApi
or AvMicroserviceApi
. They offer the benefit of having pre-defined urls, and some even have methods available for easier data fetching.
The class for each resource is exported with a capital A
while the instance is exported with a lowercase a
. For example, AvUserApi
vs avUserApi
. If you need to extend the functionality of the resource then we recommend using the class. Otherwise, we recommend using the instance.
Details about each api can be found here
AvMicroserviceApi
AvProxyApi
AvCodesApi
AvDisclaimersApi
AvFilesApi
AvFilesDeliveryApi
AvLogMessagesApi
AvLogMessagesApiV2
AvNavigationApi
AvNotificationApi
AvOrganizationsApi
AvPdfApi
AvPdfMicroserviceApi
AvPermissionsApi
AvProvidersApi
AvRegionsApi
AvRouteConfigurationsApi
AvSettingsApi
AvSlotMachineApi
AvSpacesApi
AvTelemetryApi
AvUserApi
AvUserPermissionsApi
AvWebQLApi
AvApi
Create new API definitions by extending AvApi
.
import AvApi from '@availity/api-axios';
class AvExampleResource extends AvApi {
constructor() {
super({
name: 'exampleApi',
});
}
}
export const avExampleResource = new AvExampleResource();
export default AvExampleResource;
You can use AvApi
to create a new instance that will make connecting to an endpoint much easier
import AvApi from '@availity/api-axios';
// Passing in claims as the name here means the url
// will get set to /api/v1/claims
// Now we can use the available functions to hit that url
const MyApi = new AvApi({ name: 'claims' });
// Create a function that will get entry with the id we pass in
// url will be /api/v1/claims/{id}
async function getClaim(id) {
const response = await MyApi.get(id);
return response.data;
}
Some of the pre-defined classes already have functions available to help make fetching data easier. One example is avUserApi
. It has a method me
which will fetch the currently logged in user
import { avUserApi } from '@availity/api-axios';
async function getUser() {
const user = await avUserApi.me();
return user;
}
Create new API definitions by extending AvProxyApi
. Extending AvProxyApi
provides services the behaviors described in @api-core/README#features as well as building the url to match your tenant's proxy REST conventions.
import { AvProxyApi } from '@availity/api-axios';
class AvExampleResource extends AvProxyApi {
constructor() {
super({
tenant: 'myhealthplan',
name: 'patients',
});
}
}
export default new AvExampleResource();
FAQs
Wrappers for axios designed to work with the Availity portal
The npm package @availity/api-axios receives a total of 721 weekly downloads. As such, @availity/api-axios popularity was classified as not popular.
We found that @availity/api-axios demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.