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
Parameter | Type | Description |
---|---|---|
topic | string | The topic to publish to. Usually a UUID. |
events | FhircastEventName[] | An array of event names to listen for. |
Returns:
Promise<SubscriptionRequest>
A Promise
that resolves once the request completes, or rejects if it fails.