Goal

Wallets often have profiles on other DApps; allow them to import their profile_image, username, and bio for quicker onboarding.

Background Information

Wallets are shared across Tapestry. Create Profile will create a Profile Node in your namespace, and like it to a wallet shared across namespaces.

Each DApp can read and write from its own data (namespace). You should create profiles for your users in your namespace. This allows your profiles to interact with each other (follow, like, comment, create content, etc.).

Identities endpoint allows your app to see a wallet address’s profiles on other namespaces. This is useful for making onboarding seamless. Endpoints like Suggested Profiles also read across namespaces so your users can find profiles of people they may follow on other apps (”walk into a new party but already have friends”).

Steps:

Architecture:

Tapestry requests shouldn’t happen on the client’s browser as it will leak keys, but can happen on NextJS API Routes or the applications backend.

Open Source Example

Live here: https://sse.gg/

API Create Profile Route

  1. After user connects their wallet, fetch their identities by passing their wallet address into the GET identities endpoint
    1. https://docs.usetapestry.dev/api#tag/identities
  2. Strategy 1: Display the profiles back to the user in the UI and let them click one to import it
    1. Pass the data from the user selection into the POST profiles findOrCreate endpoint
    2. Create-Profile
  3. Strategy 2: Pick an identity and create the profile on the user’s behalf
    1. You can either pick a random one from the GET identities response

    2. or prioritize based on popularity (list ordered by number of profiles descending)

      readableName namespace
      Farcaster farcaster_external
      SNS solananameservice
      X x
      Tops.fun topsfun
      All Domains allDomains
      LORE.xyz refractor
      Primitives primitives
      SSE nemoapp
      Tribe.run tribe.run
      dotblink durango
      Access Protocol accessprotocol
    3. once you’ve selected a profile for the user, pass the data from the user selection into the POST profiles findOrCreate endpoint

    4. Then show them their name, profile pic, and bio in the UI