New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@awell-health/awell-sdk

Package Overview
Dependencies
Maintainers
3
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@awell-health/awell-sdk

  • 0.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
96
decreased by-31.91%
Maintainers
3
Weekly downloads
 
Created
Source

Awell SDK

The Awell SDK provides convenient access to Awell's APIs from applications written in server-side JavaScript.

Powered by GenQL

The SDK is built using GenQL, making it easier to call Awell's API if you're using a JavaScript stack. The SDK translates JavaScript code into GraphQL queries, providing auto-completion and validation for your queries.

Installation

Install the package with:

npm install @awell-health/awell-sdk
# or
yarn add @awell-health/awell-sdk

Usage

Learn more about GenQL and its syntax 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

Configuration

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',
})
OptionRequiredDescription
environmentNo*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
apiUrlNo*The API URL. Takes presedence over the "environment" when both are specified.
apiKeyYesThe API key to use for authentication.

* The SDK will throw an error if neither environment nor apiUrl is provided.

More information

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.

Example

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

Package last updated on 28 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc