DeviceServiceClient extension type

DeviceService provides core device management and key/token management. All RPCs require authentication via Bearer token unless otherwise specified.

on
  • Transport

Constructors

DeviceServiceClient(Transport _transport)

Methods

addKey(AddKeyRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<AddKeyResponse>
AddKey stores a key or token and its material in the local storage for a device. This is used for keys generated by the service or when the service needs to manage the key material directly.
create(CreateRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<CreateResponse>
Create registers a new device in the system. Returns a unique device ID that should be stored by the client.
deRegisterKey(DeRegisterKeyRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<DeRegisterKeyResponse>
DeRegisterKey deregisters a key from a third-party service. This handles cleanup with the external service and removes the associated key metadata from local storage.
getById(GetByIdRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<GetByIdResponse>
GetById retrieves one or more devices by their unique identifiers. Supports batch retrieval for efficiency.
getBySessionId(GetBySessionIdRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<GetBySessionIdResponse>
GetBySessionId retrieves a device by its active session identifier. Useful for resolving devices from session tokens.
getTurnCredentials(GetTurnCredentialsRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<GetTurnCredentialsResponse>
Returns short-lived TURN server credentials for WebRTC media relay. Credentials are generated per-request with a configurable TTL. The server should generate HMAC-based credentials using a shared secret with the TURN server (RFC 5766 long-term credentials).
Link associates a device with a user profile. Required before the device can be used for authenticated operations.
listLogs(ListLogsRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Stream<ListLogsResponse>
ListLogs retrieves activity logs for a device. Returns a stream of log entries for the specified device.
log(LogRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<LogResponse>
Log creates a new activity log entry for a device. Used for session tracking and security auditing.
notify(NotifyRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<NotifyResponse>
Notify sends a notification to a device using one of its registered keys. The service selects an appropriate key based on key_type (e.g., FCM_TOKEN for push notifications). If key_id is provided, that specific key will be used; otherwise the service selects the best available key.
registerKey(RegisterKeyRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<RegisterKeyResponse>
RegisterKey registers a key with a third-party service using an externally-generated key or token. This method handles the integration with the external service and stores metadata about the key, but not the key material itself. Use AddKey to store key material.
remove(RemoveRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<RemoveResponse>
Remove deletes a device from the system. This operation cannot be undone.
removeKey(RemoveKeyRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<RemoveKeyResponse>
RemoveKey removes one or more keys or tokens from local storage. This does not handle deregistration from third-party services. For that, use DeRegisterKey.
Search finds devices matching specified criteria. Supports filtering by date range, properties, and full-text search.
searchKey(SearchKeyRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<SearchKeyResponse>
SearchKey searches for keys or tokens associated with a device.
update(UpdateRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<UpdateResponse>
Update modifies an existing device's information. Only the device owner or administrators can update device information.
updatePresence(UpdatePresenceRequest input, {Headers? headers, AbortSignal? signal, dynamic onHeader(Headers)?, dynamic onTrailer(Headers)?}) Future<UpdatePresenceResponse>
UpdatePresence updates the presence status of a device. Used to track online/offline status and availability for real-time features.