
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
@medplum/core
Advanced tools
The Medplum JS Client Library is a pure TypeScript library for calling a FHIR server from the browser.
Add as a dependency:
npm install @medplum/core
Create a new MedplumClient
:
import { MedplumClient } from '@medplum/core';
const medplum = new MedplumClient();
Create a MedplumClient
with additional configuration options:
import { MedplumClient } from '@medplum/core';
const medplum = new MedplumClient({
baseUrl: 'https://www.example.com/fhir/R4/',
clientId: 'MY_CLIENT_ID',
});
const medplum = new MedplumClient();
await medplum.startClientLogin(MY_CLIENT_ID, MY_CLIENT_SECRET);
If you are using Medplum as your FHIR server, you can use a direct sign-in API to authenticate email and password.
Before you begin
After that, you can use the startLogin()
method:
const loginResult = await medplum.startLogin({ email, password, remember });
const profile = await medplum.processCode(loginResult.code);
console.log(profile);
Authenticate with a FHIR server via OAuth2 redirect:
medplum.signInWithRedirect().then((user) => console.log(user));
Search for any resource using a FHIR search string:
search<K extends ResourceType>(
resourceType: K,
query?: URLSearchParams | string,
options: RequestInit = {}
): ReadablePromise<Bundle<ExtractResource<K>>>
Example:
const bundle = await medplum.search('Patient', 'given=eve');
bundle.entry.forEach((entry) => console.log(entry.resource));
createResource<T extends Resource>(resource: T): Promise<T>
Example:
medplum.createResource({
resourceType: 'Observation',
subject: {
reference: 'Patient/123',
},
valueQuantity: {
// ...
},
// ...
});
readResource<T extends Resource>(resourceType: string, id: string): Promise<T>
Example:
const patient = await medplum.readResource('Patient', '123');
readHistory<T extends Resource>(resourceType: string, id: string): Promise<Bundle<T>>
Example:
const historyBundle = await medplum.readHistory('Patient', '123');
readVersion<T extends Resource>(resourceType: string, id: string, vid: string): Promise<T>
Example:
const version = await medplum.readVersion('Patient', '123', '456');
updateResource<T extends Resource>(resource: T): Promise<T>
Example:
const result = await medplum.updateResource({
resourceType: 'Patient',
id: '123',
name: [
{
family: 'Smith',
given: ['John'],
},
],
});
console.log(result.meta.versionId);
deleteResource(resourceType: string, id: string): Promise<any>
Example:
await medplum.deleteResource('Patient', '123');
patchResource<T extends Resource>(resourceType: string, id: string, operations: Operation[]): Promise<T>
Example:
const result = await medplum.patchResource('Patient', '123', [
{ op: 'replace', path: '/name/0/family', value: 'Smith' },
]);
console.log(result.meta.versionId);
graphql(query: string, options?: RequestInit): Promise<any>
Example:
const result = await graphql(`
{
PatientList(name: "Alice") {
name {
given
family
}
}
}
`);
Medplum is a healthcare platform that helps you quickly develop high-quality compliant applications. Medplum includes a FHIR server, React component library, and developer app.
Apache 2.0. Copyright © Medplum 2025
FAQs
Medplum TS/JS Library
The npm package @medplum/core receives a total of 44,971 weekly downloads. As such, @medplum/core popularity was classified as popular.
We found that @medplum/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.