🌴
VitalEarth SDK
  • 🌍VitalEarth SDK
  • 🐢Get Started
  • 😀One-click Onboarding
  • 🖼️Social Profiles
  • 👟Fitness Data
  • ♻️Recycling Suggestions
  • 📺Ad Network
Powered by GitBook
On this page

One-click Onboarding

One-Click Onboarding with the VitalEarth SDK

PreviousGet StartedNextSocial Profiles

Last updated 1 year ago

The VitalEarth SDK makes user onboarding a breeze, simplifying the process to a single line of code. With our SDK, you don't need to worry about wallets, networks, or Ether connectors.

Here's how you can achieve one-click onboarding for your users:

Prerequisites

Before implementing one-click onboarding, make sure you've completed the installation and initialization of the VitalEarth SDK as described in the previous steps.

One-Click Onboarding Code

To enable one-click onboarding for your users, follow these steps:

import { authClient } from "vitalearth-sdk";

// Initialize the Vitalearth SDK with your network and app name
const client = new authClient("test", "YourAppName"); // Replace "YourAppName" with your app's name

// Call the login function to initiate one-click onboarding
await client.login();

Explanation of the code:

  1. Import the authClient module from the VitalEarth SDK.

  2. Initialize the client object by creating a new instance of authClient. You'll need to specify the network ("test" or "main") and your app name. Replace "YourAppName" with your actual app's name.

  3. Use await client.login(); to trigger the one-click onboarding process. This single line of code will handle the authentication and onboarding for your users, eliminating the need for them to set up wallets or deal with network configurations.

By implementing this code in your application, users can seamlessly join your sustainability-focused platform with just one click, making it easy for them to get started and engage with your eco-conscious features.

With VitalEarth, user onboarding is no longer a barrier to entry. You can now focus on delivering a user-friendly and sustainable experience to your audience.

😀