Unity SDK
Overview
The Ramper Unity SDK is a no-code integration solution for Unity projects to have embedded Web3 wallet and dapp-to-wallet signatures signing within their app, allowing their users to instantly own a self-custodial wallet just by signing in with Email or SSO (Gmail, Facebook, Twitter, Apple ID, Telegram). Onboarding Web2 users to onchain has been never this easy!
Supported platform
Android
iOS
Installation
Download and Import: Download the unity-ramper-latest.unitypackage and import it into your Unity project.
Setup
After installation, you need to configure the SDK settings.
1. Open the Settings Asset:
Go to the Unity top menu and select Ninety Eight > Ramper SDK Setting.
2. Configure the Settings:
App ID: Enter the appId provided by Ninety Eight.
Game Slug: Enter the gameSlug provided by Ninety Eight.
Is Debug: Toggle this option to enable or disable debug logs.
Demo Wallet: For testing in the Unity editor, enter a fixed wallet address to simulate wallet interactions. These settings ensure that your SDK is properly configured for use within your Unity project.
Usage
Connecting to a Wallet
Basic login method
Use the Login method to connect to a Web3 wallet. This method opens a web view for the user to authenticate their wallet.
Parameters
message: The message to sign with the wallet. An empty string is acceptable.
Login direct with Provider
LoginDirect is a function that supports custom social login buttons in your app.
Parameters
provider: The provider directs to the login method for Ramper.
message: The message to sign with the wallet. An empty string is acceptable.
We support the four most common providers: google, apple, facebook and email.
Signing a Message
The SignMessage method allows you to sign messages, which is essential for authentication and transaction verification in Web3 applications.
Signing a Transaction
You can sign transactions using the SignTransaction method. This is critical for executing actions on the blockchain.
Dependencies
Unity: Version 2020.3 or higher.
WebView: The SDK leverages a web view for user authentication.
Last updated