Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Latest commit

 

History

History
35 lines (22 loc) · 1.22 KB

getmetadatabyissuer.md

File metadata and controls

35 lines (22 loc) · 1.22 KB
description
Retrieves information about user by the supplied "issuer".

getMetadataByIssuer

Arguments

getMetadataByIssuer(issuer)

Returns

Promise<{ issuer, email, publicAddress }>: an object containing the issuer, email and cryptographic public address of the authenticated user.

  • issuer (String): The Decentralized ID of the user. We recommend this value to be used as the user ID in your own tables.
  • email (String): Email address of the authenticated user.
  • publicAddress(String): The authenticated user's public address (a.k.a.: public key). Currently, this value is associated with the Ethereum blockchain.

Example

const { Magic } = require('@magic-sdk/admin');
const mAdmin = new Magic('SECRET_API_KEY');

...

// Grabs the issuer from a DID Token
const issuer = mAdmin.token.getIssuer(DIDToken);

// Gets user metadata based on the given issuer
const metadata = await mAdmin.users.getMetadataByIssuer(issuer);