Socket
Socket
Sign inDemoInstall

@magic-sdk/admin

Package Overview
Dependencies
23
Maintainers
19
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @magic-sdk/admin

Magic Authentication Admin Javascript SDK.


Version published
Maintainers
19
Created

Readme

Source

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);
}

FAQs

Last updated on 23 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc