<@U04UQ68083H> How to get user metadata via the JS...
# ory-copilot
m
@chilly-king-10285 How to get user metadata via the JS SDK?
b
A message from kapa.ai
To get user metadata via the JavaScript SDK, you would typically use the admin APIs provided by Ory. However, the provided knowledge sources do not include a direct example of how to do this using the JavaScript SDK. The relevant admin APIs for managing metadata are: - [
POST /admin/identities
](https://www.ory.sh/docs/reference/api#operation/createIdentity) - [
GET /admin/identities
](https://www.ory.sh/docs/reference/api#operation/listIdentities) - [
GET /admin/identities/{id}
](https://www.ory.sh/docs/reference/api#operation/getIdentity) - [
PUT /admin/identities/{id}
](https://www.ory.sh/docs/reference/api#operation/updateIdentity) You would need an API Key to call these endpoints. You can read more about [Authorization with API Keys](https://www.ory.sh/docs/concepts/personal-access-token) in the Ory documentation. Please refer to the [Ory SDK documentation](https://www.ory.sh/docs/guides/upgrade/sdk-v1) for more details on how to use the SDK to interact with these APIs.
m
For anyone reading this after the fact, that’s just for Admin metadata. Public can be accessed via
whoami
or calling `toSession()`:
Copy code
There are two types of identity metadata:

Public: Attributes that can only be modified using the /admin/identities APIs. They are visible to anyone having access to the user's sessions, for example by calling toSession() or /sessions/whoami. This allows you to access the metadata in the frontend without calling the admin APIs.

Admin: Attributes that can only be modified and read using the /admin/identities APIs.