@flexpa/node-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

@flexpa/node-sdk

The NodeSDK simplifies the process of integrating Flexpa by providing a strongly-typed client for calling Flexpa APIs.

Installation

With yarn:

yarn add @flexpa/node-sdk

With npm:

npm install @flexpa/node-sdk

With pnpm:

pnpm install @flexpa/node-sdk

Usage

Initialize FlexpaClient (from Link Exchange)

import FlexpaClient, { IntrospectResponse } from '@flexpa/node-sdk';

const flexpaClient = await FlexpaClient.fromExchange(myPublicToken, mySecretKey, 'https://api.flexpa.com');
const tokenData: IntrospectResponse = await flexpaClient.introspect();

Initialize FlexpaClient (from Access Token)

import FlexpaClient from '@flexpa/node-sdk';

const flexpaClient = new FlexpaClient(myAccessToken);
// Or: const flexpaClient = new FlexpaClient(myAccessToken, "https://api.flexpa.com");

Reading a FHIR Resource

import * as r4 from 'fhir/r4';
import { FlexpaClient } from '@flexpa/node-sdk';

const flexpaClient = new FlexpaClient(myAccessToken);
const patient: r4.Patient = await flepxaClient.read('Patient', '$PATIENT_ID');

Searching a FHIR Resource

import * as r4 from 'fhir/r4';
import { FlexpaClient } from '@flexpa/node-sdk';

const flexpaClient = new FlexpaClient(myAccessToken);
const bundle: r4.Bundle = await flepxaClient.search('Patient', { given: 'john', family: 'doe' });

Publishing to NPM

FAQ

Topic Answer Comments
Runtime Node
Build Through yarn yarn build

Readme

Keywords

none

Package Sidebar

Install

npm i @flexpa/node-sdk

Weekly Downloads

13

Version

0.0.5

License

none

Unpacked Size

291 kB

Total Files

33

Last publish

Collaborators

  • jdjkelly
  • alex-yakubovsky
  • acr13