Get Started

Reference for the Magic Admin SDK for Ruby: https://github.com/magiclabs/magic-admin-ruby

note

We will also be releasing magic-admin-rails to offer the direct magic-admin SDK integration for the Ruby Web frameworks.

Overview

The Magic SDK for server-side Ruby makes it easy to leverage Decentralized ID Tokens to authenticate your users 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

Current SDK is built with ruby-2.5. Testing for ruby-2.5+ will be added soon.

gem install magic-admin

Creating an SDK Instance

To instantiate:

require 'magic-admin'
# Pass your API secret key directly to the Magic.
magic = Magic.new(api_secret_key: '<YOUR_API_SECRET_KEY>')
# Or add an environment variable, `MAGIC_API_SECRET_KEY`
magic = Magic.new