Magic SMS for Web

Magic SMS for Web

New to Magic?

Create a fully-functional Magic auth demo in minutes.

Build a demo

Reference for the Magic SDK for web / client-side JavaScript: https://github.com/magiclabs/magic-js

#Create a New Magic App

#Locally (Recommended)

  1. To create a new Magic project from scratch, run: npx make-magic --template hello-world-sms
  2. You'll be guided through some presets:
  3. At the end, you'll have a working Magic app!

Learn more about make-magic, our CLI tool that vastly simplifies project creation.

#On the web

Checkout our Build a Demo tutorial for a step-by-step guide to get up and running with your first SMS authentication.

#Add to an existing website

#NPM

npm install --save magic-sdk

#Yarn

yarn add magic-sdk

#CDN

<script src="https://auth.magic.link/sdk"></script>

#Create an SDK Instance

#ES Modules/TypeScript

import { Magic } from 'magic-sdk';

const magicClient = new Magic('API_KEY'); // ✨

#CommonJS

const { Magic } = require('magic-sdk');

const magicClient = new Magic('API_KEY'); // ✨

#Make a Request

const DID = await magicClient.auth.loginWithSMS({
  phoneNumber: '+14151231234',
});
// Consume decentralized identity (DID)

Server-side SDKs?

Integrate Magic with your existing backend.