Get Started

Reference for the Magic Admin SDK for Node.js / server-side JavaScript: https://github.com/magiclabs/magic-admin-js

Overview

The Magic SDK for server-side JavaScript makes it easy to leverage Decentralized ID Tokens to protect routes and restricted resources for your app. This guide will cover some important topics for getting started with server-side APIs and to make the most of Magic's features.

  • Install the Magic Admin SDK to get started

  • View the API documentation below to learn the methods you'll be using

  • Go to Examples for an introduction to common patterns and use-cases

note

Looking for a client-side API instead? Check out:

๐Ÿ‘‰ Magic Client SDK for web

๐Ÿ‘‰ Magic Client SDK for React Native

Installation

npm install --save @magic-sdk/admin

Creating an SDK Instance

Examples for the server-side JavaScript SDK use the CommonJS pattern by default.

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