The Magic Admin SDK lets developers secure endpoints, manage users, and create middlewares via easy-to-use utilities.
License · Changelog · Contributing Guide
See the developer documentation to learn how you can master the Magic Admin SDK in a matter of minutes.
Integrating your Node.js application with Magic will require our server-side NPM package:
# Via NPM:
npm install --save @magic-sdk/admin
# Via Yarn:
yarn add @magic-sdk/adminSign up or log in to the developer dashboard to receive API keys that will allow your application to interact with Magic's administration APIs.
const{ Magic }=require('@magic-sdk/admin');// In async function:constmagic=awaitMagic.init('YOUR_SECRET_API_KEY');// ORMagic.init('YOUR_SECRET_API_KEY').then((magic)=>{magic});// Validate a tokentry{magic.token.validate("DIDToken");}catch(e){console.log(e);}// Magic Auth - Get User Emailtry{awaitmagic.users.getMetadataByToken("DIDToken");}catch(e){console.log(e);}