Skip to main content

Getting Started

This guide will help you install and get started with Unforgettable SDK.

Requirements

Web / React / React Native

  • Node.js 18+ or modern browser with Web Crypto API support
  • TypeScript 5.0+ (optional but recommended)

Android

  • Android SDK 21+ (Android 5.0 Lollipop)
  • Kotlin 1.9+
  • Java 17+

iOS

  • iOS 13.0+ / macOS 10.15+ / tvOS 13.0+ / watchOS 6.0+
  • Swift 5.9+
  • Xcode 15.0+

Installation

Choose your platform and install the SDK:

npm install @rarimo/unforgettable-sdk

Quick Start

Let's create a simple recovery flow where users can set up a new private key.

Step 1: Initialize the SDK

import { UnforgettableSdk, RecoveryFactor } from '@rarimo/unforgettable-sdk'

const sdk = new UnforgettableSdk({
mode: 'create',
factors: [RecoveryFactor.Face, RecoveryFactor.Image, RecoveryFactor.Password],
})

Step 2: Generate Recovery URL

const recoveryUrl = await sdk.getRecoveryUrl()
console.log('Recovery URL:', recoveryUrl)
// Display this as a QR code for users to scan

Step 3: Poll for Recovered Key

import { NotFoundError } from '@rarimo/unforgettable-sdk'

async function pollForKey() {
const maxAttempts = 60
let attempts = 0

while (attempts < maxAttempts) {
try {
const recoveryKey = await sdk.getRecoveredKey()
console.log('✅ Recovery successful!', recoveryKey)
return recoveryKey
} catch (error) {
if (error instanceof NotFoundError) {
attempts++
await new Promise(resolve => setTimeout(resolve, 3000))
} else {
throw error
}
}
}

throw new Error('Recovery timeout')
}

pollForKey()

Next Steps

Explore platform-specific guides for detailed examples and advanced features:

  • Web - QR code implementation for browsers
  • React - Hooks and components
  • React Native - WebView integration
  • Android - Native Android implementation
  • iOS - Native iOS implementation

Key Concepts

Before diving deeper, understand these core concepts:

  • Mode: Either create (for setting up a new key) or restore (for recovering an existing key)
  • Recovery Factors: The methods users can choose to create/restore their key (Face, Image, Password)
  • Recovery URL: A secure link that users scan/open to complete the recovery process
  • Data Transfer: The encrypted communication between your app and Unforgettable.app
  • QR Code (Web): Web apps display QR codes for users to scan with mobile devices
  • WebView (Mobile): Mobile apps open the recovery URL in a WebView for in-app recovery