Skip to main content

Overview

Magic provides wallet infrastructure with two integration paths:
  • Embedded Wallets: Client-side Magic SDK handles authentication and signing. Keys are managed by Magic and signing happens through their RPC provider.
  • Server Wallets: Backend-managed wallets via Magic Express API. Keys live in Magic’s TEE (Trusted Execution Environment) and signing happens through server-side API calls.
Both paths produce a viem-compatible account that becomes the owner of a Rhinestone smart account, enabling cross-chain functionality.

Integration

Prerequisites

  • A Magic account and publishable API key
  • Rhinestone API key
  • React application setup
1

Install Dependencies

2

Set Up Magic SDK

Initialize the Magic SDK in your application:
3

Authenticate and Get Wallet Address

Use Magic’s client-side SDK for authentication:
Magic also supports SMS, social login, WebAuthn, and more. See Magic’s authentication overview for all options.
4

Create Rhinestone Account

Create a viem account from Magic’s provider and pass it to Rhinestone:

Cross-Chain Transactions

Once initialized, both wallet types use the same Rhinestone API:

Environment Variables

Make sure to set the following environment variables:

Next Steps