@magic-sdk/admin
TypeScript icon, indicating that this package has built-in type declarations

2.4.1 • Public • Published

Magic Authentication Admin Javascript SDK

Publish

The Magic Admin SDK lets developers secure endpoints, manage users, and create middlewares via easy-to-use utilities.

License · Changelog · Contributing Guide

📖 Documentation

See the developer documentation to learn how you can master the Magic Admin SDK in a matter of minutes.

🔗 Installation

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/admin

⚡️ Quick Start

Sign 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:
const magic = await Magic.init('YOUR_SECRET_API_KEY');
// OR
Magic.init('YOUR_SECRET_API_KEY').then((magic) => {
  magic
});
// Validate a token
try {
  magic.token.validate("DIDToken");
} catch (e) {
  console.log(e);
}
// Magic Auth - Get User Email
try {
  await magic.users.getMetadataByToken("DIDToken");
} catch (e) {
  console.log(e);
}

Readme

Keywords

none

Package Sidebar

Install

npm i @magic-sdk/admin

Weekly Downloads

15,895

Version

2.4.1

License

MIT

Unpacked Size

1.37 MB

Total Files

88

Last publish

Collaborators

  • romin-halltari
  • darrentmagic
  • magictristan
  • musicbender
  • chris-magic
  • jay.hwang
  • benmagic
  • hcote
  • josh_scanlan
  • sgdheeban
  • mikeysight
  • damianjachyra
  • jasonatmagic
  • magiclabs_fe
  • bcleary06
  • seanli
  • ethella
  • jmjin
  • dizigen