Go to Dashboard
Get StartedNodeDataWalletsRollupsChangelog
Get StartedNodeDataWalletsRollupsChangelog
  • Overview
    • Overview
    • Quickstart
    • Supported Chains
  • Transactions
    • Overview
    • Send transactions
    • Using EIP-7702
    • Send batch transactions
    • Sponsor gas
    • Pay gas with any token
    • [NEW] Same-chain swaps
    • [NEW] Cross-chain swaps
    • Send parallel transactions
    • Retry transactions
    • Sponsor gas on Solana
    • Configure client
  • Low-Level Infra
    • Overview
    • Quickstart
    • Bundler
  • Authentication
    • Overview
    • Solana wallets
    • Server wallets
    • What is a signer?
  • API Reference
  • SDK Reference
    • AA-SDK core
    • AA-SDK ethers
    • Other Javascript Frameworks
    • Infra
    • React
    • React Native
    • React Native Signer
    • Signer
    • Smart contracts
    • Wallet client
  • Resources
    • Features
    • Understanding Smart Wallets
    • GitHub
    • Changelog
    • Contributing
    • Gas benchmarks
    • Migrating to 4.x.x
    • Terms
    • Types
    • Middleware
    • Contact us
Go to Dashboard
LogoLogo
On this page
  • Setup your application
  • Setup the Alchemy Accounts Provider
  • Choose your authentication
  • Next Steps
OverviewGet StartedReact NativeFrom scratch

In this step you will get your authentication working so users can login with their smart wallets.

Setup your application

First, configure your application and your API Key:

  1. Create an app in the dashboard and copy the API Key.

  2. Create a configuration in the Smart Wallets dashboard to enable login methods.

Hold onto your API Key for the next step.

Setup the Alchemy Accounts Provider

Now set up and configure the Alchemy Accounts Provider in your project.

You can do this by wrapping the top level component (e.g. _layout.tsx in Expo or App.tsx in Bare React Native) in your app with the AlchemyAccountsProvider component from the @account-kit/react-native package.

Here’s an example of how to do this:

1import "react-native-get-random-values"; // Shims for the crypto module
2import React from "react";
3import { alchemy, sepolia } from "@account-kit/infra";
4import {
5 AlchemyAccountProvider,
6 createConfig,
7} from "@account-kit/react-native";
8import { QueryClient } from "@tanstack/react-query";
9
10const queryClient = new QueryClient();
11
12const config = createConfig({
13 chain: sepolia,
14 transport: alchemy({
15 apiKey: "YOUR_ALCHEMY_API_KEY",
16 }),
17 signerConnection: {
18 apiKey: "YOUR_ALCHEMY_API_KEY",
19 },
20 sessionConfig: {
21 expirationTimeMs: 1000 * 60 * 60 * 24, // <-- Adjust the session expiration time as needed (currently 24 hours)
22 },
23});
24
25export default function App() {
26 return (
27 <AlchemyAccountProvider config={config} queryClient={queryClient}>
28 {/* The rest of your app here... */}
29 </AlchemyAccountProvider>
30 );
31}

Choose your authentication

Now that you have set up the Alchemy Accounts Provider, you can setup your authentication!

You can choose from many authentication guides with react native instructions, like this one on Email One-Time Passwords.

Next Steps

Once you have authentication working, you can explore additional features:

Send User Operations

Learn how to perform transactions by sending user operations with your smart wallet.

Add Gas Sponsorship

Enable gasless transactions by setting up gas sponsorship for your users.

Was this page helpful?
Previous

Other Javascript Frameworks

Next
Built with
Setup authentication to smart wallets on React Native