Skip to main content

core.medplumclient.fhircastsubscribe

Home > @medplum/core > MedplumClient > fhircastSubscribe

MedplumClient.fhircastSubscribe() method

Subscribes to a specified topic, listening for a list of specified events.

Once you have the SubscriptionRequest returned from this method, you can call fhircastConnect(subscriptionRequest) to connect to the subscription stream.

Signature:

fhircastSubscribe(topic: string, events: FhircastEventName[]): Promise<SubscriptionRequest>;

Parameters

ParameterTypeDescription
topicstringThe topic to publish to. Usually a UUID.
eventsFhircastEventName[]An array of event names to listen for.

Returns:

Promise<SubscriptionRequest>

A Promise that resolves once the request completes, or rejects if it fails.