Get Started with Go
Reference for the Magic Admin SDK for Golang: https://github.com/magiclabs/magic-admin-go
Overview
The Magic SDK for server-side Golang 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:
Installation
The SDK requires Golang 1.13+
and Go Modules. To make sure your project is using Go Modules, you can look for go.mod
file in your project's root directory. If it exits, then you are already using the Go Modules. If not, you can follow this guide to migrate to Go Modules.
Simply reference magic-admin-go
in a Go program with an import
of the SDK:
Run any of the normal go
commands (ex: build
/install
). The Go toolchain will take care of fetching the SDK automatically.
Alternatively, you can explicitly go get
the package into a project:
Creating an SDK Client Instance
The Client
handles all the Magic API requests for your application. To instantiate:
Creating a Token Instance
The Token
provides methods to interact with DID Token.