![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@awell-health/awell-sdk
Advanced tools
The Awell SDK provides convenient access to Awell's APIs and webhooks from applications written in server-side JavaScript. The SDK also exports all of our GraphQL types.
Install the package with:
npm install @awell-health/awell-sdk
# or
yarn add @awell-health/awell-sdk
Learn more about the syntax of the SDK here.
Remember to always call the SDK on the server to keep your API key secure.
import { AwellSdk } from '@awell-health/awell-sdk'
// Create the SDK
const sdk = new AwellSdk({
environment: 'production-eu',
apiKey: 'YOUR_API_KEY',
})
// Perform your query our mutation
const result = await sdk.orchestration.query({
publishedPathwayDefinitions: {
publishedPathwayDefinitions: {
id: true,
title: true,
version: true,
release_id: true,
},
},
})
const definitions =
result.publishedPathwayDefinitions.publishedPathwayDefinitions
You can minimize network requests and server load fetching queries that are near in time using batching.
const sdk = new AwellSdk({
apiUrl: process.env.AWELL_API_URL,
apiKey: process.env.AWELL_API_KEY,
})
// These queries will trigger only one network request
const res = await Promise.all([
sdk.orchestration.query({
pathway: {
__args: {
id: 'pathway-1',
},
success: true,
pathway: {
__scalar: true
},
},
}),
sdk.orchestration.query({
pathway: {
__args: {
id: 'pathway-2',
},
success: true,
pathway: {
__scalar: true
},
},
}),
])
Browse all types here or use our GraphQL playground to browse the GraphQL schema.
Types can be imported as follows:
import { type Pathway, type Form } from '@awell-health/awell-sdk'
import {
AwellSdk,
type WebhookEvent,
type WebhookPayload
} from '@awell-health/awell-sdk'
const PUBLIC_KEY = 'your_public_key' // Available in Awell Studio
app.post(
'/awell-webhook-listener',
express.json({ type: 'application/json' }),
(request, response) => {
// Needed if you want to verify the incoming webhook
const signature = req.headers['x-awell-signature'] as string;
const requestBody = request.body as WebhookPayload
const sdk = new AwellSdk({
environment: 'production-eu',
apiKey: 'YOUR_API_KEY',
})
/**
* Verify that the incoming webhook has been sent
* by Awell and has not been tampered with
*/
const isValid = sdk.webhooks.verify(
requestBody,
signature,
PUBLIC_KEY,
)
// If webhook you received is legitimate, you can process it
if (isValid) {
const { event } = requestBody
// Handle the event
switch (event.event_type) {
case WebhookEvent.PATHWAY_STARTED: {
const pathway = event?.pathway
console.log(pathway)
// Your code
break
}
default:
console.log(`Unhandled event type ${event.event_type}`)
}
}
// Return a response to acknowledge receipt of the event
response.json({ received: true })
},
)
The SDK can be initialized with the following options:
const sdk = new AwellSdk({
environment: 'sandbox',
apiUrl: 'https://api.sandbox.awellhealth.com/orchestration/m2m/graphql',
apiKey: 'YOUR_API_KEY',
})
Option | Required | Description |
---|---|---|
environment | No* | The Awell environment to use for the SDK. The SDK will automatically target the correct endpoint for the environment you specified. Following options are allowed: development | staging | sandbox | production-eu | production-us | production-uk |
apiUrl | No* | The API URL. Takes presedence over the "environment" when both are specified. |
apiKey | Yes | The API key to use for authentication. |
* The SDK will throw an error if neither environment nor apiUrl is provided.
You can browse our Developer Hub to learn more about all queries and mutations. Everything documented on the Developer Hub is available through the SDK.
The Get patient query as documented on the Developer Hub can be used as follows:
const res = await sdk.orchestration.query({
patient: {
__args: {
id: 'some_patient_id', // Variable
},
patient: {
id: true,
profile: {
__scalar: true, // get all unnested scalar fields
identifier: {
__scalar: true, // get all scalar fields within identifier object
},
address: {
street: true,
city: true,
zip: true,
state: true,
country: true,
},
},
},
},
})
FAQs
Unknown package
The npm package @awell-health/awell-sdk receives a total of 207 weekly downloads. As such, @awell-health/awell-sdk popularity was classified as not popular.
We found that @awell-health/awell-sdk 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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.