Skip to content

Add a method to retrieve the device key for the currently logged-in device #3100

@harsh62

Description

@harsh62

Problem

Currently, there is no public API in Amplify Auth to retrieve the device key (device ID) for the currently logged-in user. While Auth.fetchDevices() retrieves trusted devices, it does not return the key for the current (active) device—especially if it's an untrusted but tracked device. Additionally, the Hub sign-in event does not expose this information in its payload.

Proposed Solution

Introduce a new property or method under Auth—such as Auth.currentDeviceKey or Auth.getCurrentDeviceId()—to return the device key for the currently active session. This would allow developers to access the device key directly without relying on internal workarounds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    authRelated to the Auth category/pluginsfeature-requestRequest a new feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions