Skip to content

Commit

Permalink
Merge branch 'main' into PDEEXP-2080-fix-wagmi-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuascan committed Nov 26, 2024
2 parents 461b5ad + c0ffea2 commit 01e3650
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ DEPRECATED: `MagicAuthConnector` and `MagicConnectConnector` have been replaced
# ⭐ Usage

```javascript
import { DedicatedWalletConnector, UniversalWalletConnector } from '@magiclabs/wagmi-connector';
import { dedicatedWalletConnector, universalWalletConnector } from '@magiclabs/wagmi-connector';

// Dedicated Wallet integration
const connector = new DedicatedWalletConnector({
const connector = dedicatedWalletConnector({
options: {
apiKey: YOUR_MAGIC_PUBLISHABLE_API_KEY, //required
//...Other options
},
});

// Universal Wallet integration
const connector = new UniversalWalletConnector({
const connector = universalWalletConnector({
options: {
apiKey: YOUR_MAGIC_PUBLISHABLE_API_KEY, //required
//...Other options
Expand Down Expand Up @@ -149,7 +149,7 @@ You can provide a callback URL to redirect the user to after authentication. the
You configure OAuth with magic by adding the following options to the connector:

```javascript
const connector = new DedicatedWalletConnector({
const connector = dedicatedWalletConnector({
options: {
apiKey: YOUR_MAGIC_PUBLISHABLE_API_KEY, //required
oauthOptions : {
Expand All @@ -168,7 +168,7 @@ To retrieve the Magic redirect result when a user is authenticated and logged in
You can enable SMS authentication by adding the following options to the connector:

```javascript
const connector = new DedicatedWalletConnector({
const connector = dedicatedWalletConnector({
options: {
apiKey: YOUR_MAGIC_PUBLISHABLE_API_KEY, //required
enableSMSLogin: true, //optional (default: false)
Expand All @@ -184,7 +184,7 @@ You have to enable SMS authentication in your [Magic dashboard](https://dashboar
By default Email is set to true as default. if you wish to remove Email OTP, pass `enableEmailLogin: false` in options object as follows :

```javascript
const connector = new DedicatedWalletConnector({
const connector = dedicatedWalletConnector({
options: {
apiKey: YOUR_MAGIC_PUBLISHABLE_API_KEY, //required
enableEmailLogin: false, //optional (default: true)
Expand All @@ -199,9 +199,9 @@ const connector = new DedicatedWalletConnector({
You can customize the modal's theme, default accent color, logo and header text.

```javascript
import { DedicatedWalletConnector } from '@magiclabs/wagmi-connector';
import { dedicatedWalletConnector } from '@magiclabs/wagmi-connector';

const connector = new DedicatedWalletConnector({
const connector = dedicatedWalletConnector({
options: {
apiKey: YOUR_MAGIC_PUBLISHABLE_API_KEY,
accentColor: '#ff0000',
Expand All @@ -224,15 +224,15 @@ To use the connector with Rainbow kit, create a new file `RainbowMagicConnector.
```javascript
// RainbowMagicConnector.ts

import { UniversalWalletConnector } from '@magiclabs/wagmi-connector';
import { universalWalletConnector } from '@magiclabs/wagmi-connector';

export const rainbowMagicConnector = ({ chains }: any) => ({
id: 'magic',
name: 'Magic',
iconUrl: 'https://svgshare.com/i/iJK.svg',
iconBackground: '#fff',
createConnector: () => {
const connector = new UniversalWalletConnector({
const connector = universalWalletConnector({
chains: chains,
options: {
apiKey: 'YOUR_MAGIC_CONNECT_API_KEY',
Expand Down

0 comments on commit 01e3650

Please sign in to comment.