Package Exports
- @magic-ext/connect
Readme
๐ Magic Connect Extension for Web Browsers
With the Magic Connect JavaScript SDK extension, you can plug into your favorite social login providers with one, easy-to-use API.
License ยท Changelog ยท Contributing Guide
๐ Documentation
See the developer documentation to learn how to get started with Connect in Magic SDK.
๐ Installation
Integrating your app with Magic will require our client-side NPM package and the Connect extension:
# Via NPM:
npm install --save magic-sdk @magic-ext/connect
# Via Yarn:
yarn add magic-sdk @magic-ext/connect
Alternatively, you can load via CDN with by adding a script tag to your appโs <head>
:
<script src="https://cdn.jsdelivr.net/npm/magic-sdk/dist/magic.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@magic-ext/connect/dist/extension.js"></script>
โก๏ธ 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 APIs.
From your login page:
import Web3 from 'web3';
import { Magic } from 'magic-sdk';
import { ConnectExtension } from '@magic-ext/connect';
const magic = new Magic('YOUR_API_KEY', {
extensions: [new ConnectExtension()],
network: testnetOrMainnet
});
const web3 = new Web3(magic.rpcProvider);
await web3.eth.getAccounts();