Superwall

identify()

Creates an account with Superwall by linking the provided userId to Superwall's automatically generated alias.

Deprecated SDK

We strongly recommend migrating to the new Superwall Expo SDK, see our migration guide for details.

Purpose

Creates an account with Superwall by linking the provided userId to Superwall's automatically generated alias. Call this function as soon as you have a valid userId.

Signature

async identify({
  userId,
  options,
}: {
  userId: string
  options?: IdentityOptions
}): Promise<void>

Parameters

Prop

Type

Returns / State

Returns a Promise that resolves once the identification process is complete.

Usage

Basic identification:

await Superwall.shared.identify({
  userId: "user123"
})

With options to restore paywall assignments:

import { IdentityOptions } from "@superwall/react-native-superwall"

const options = new IdentityOptions()
options.restorePaywallAssignments = true

await Superwall.shared.identify({
  userId: "user123",
  options: options
})

When to Call

Call identify() as soon as you have a valid userId in your app. This is typically:

  • After user login
  • After user registration
  • When restoring a previous session
  • On app launch if the user is already logged in

How is this guide?

Edit on GitHub