Skip to content

Onboarding ​

What the person sees. The steps Instagram shows a new account before its feed: the person's own profile card (OnboardingProfileCardScreen), a prompt to find their friends on Facebook (OnboardingFindFacebookFriendsPromptScreen), suggested people to follow (OnboardingDiscoverPeopleScreen), a prompt to add an email address (OnboardingAddEmailScreen) and a reels-tuning grid (OnboardingReelsTuningScreen). The registration's terms screen's agree() starts the chain: its Created answer carries the profile card.

What you do. Each screen's action moves to the next: the card's "Next" (confirmProfileCard()) and each step's "Skip" (skipFindingFacebookFriends(), skipDiscoverPeople(), skipAddingEmail(), skipReelsTuning()). The last skip opens the feed.

The chain's server state is the process's, not an edge argument: the step list and the reels tuning list's cursors are read at the launch and by the steps themselves, and a step sends the requests the recording shows while it is in front. The screens are Android 453.

What these screens do not offer. The person's own inputs are the recorded ones: confirmProfileCard() and the four skips. Adding an email address, connecting Facebook, following a suggested person and rating a reel are not modelled, and the screens return no list at all — no suggestions, no friends, no reels: the library reproduces the steps' actions, their requests and their wire, not what they show.

No screenshot: every frame needs a freshly created test account, so the walk has none.

Every example starts a fresh install: AndroidIgpapi.install({ seed, main }) hands main the login screen, and the examples answer no errors, so each one stays on its path. Every action can fail with typed errors; answer them with Effect.catchTag, as Create an account does (Errors), and challenges with your otherwise constant (Challenges).

ts
import { AndroidIgpapi } from '@igpapi/android';
import { Effect } from 'effect';

// Placeholders: the person's answers come from your own system.
const phoneNumber = process.env['IG_PHONE_NUMBER'] ?? '';
const password = process.env['IG_PASSWORD'] ?? '';
const readCode = Effect.sync((): string => process.env['IG_SMS_CODE'] ?? '');

The matrix ​

#The person...Starts onActionsResult
1Confirms their profile cardthe registration's launchconfirmProfileCard()The Facebook-friends prompt
2Skips the promptsthe promptskipFindingFacebookFriends(), skipDiscoverPeople(), skipAddingEmail()The next step, and then the reels tuning
3Skips the reels tuningthe reels tuningskipReelsTuning()The feed

The scenario ​

ts
// A created account walks the onboarding chain to the feed. The chain's steps
// start where the registration's `agree()` left off.
const outcome = await AndroidIgpapi.install({
  seed: 'new-account',
  main: home =>
    Effect.gen(function* () {
      const phone = yield* home.createNewAccount();
      const confirmation = yield* phone.submitPhoneNumber(phoneNumber);
      const smsCode = yield* readCode;
      const passwordScreen = yield* confirmation.submitConfirmationCode(smsCode);
      const birthday = yield* passwordScreen.submitPassword(password);
      const name = yield* birthday.submitBirthday({ day: 14, month: 6, year: 1997 });
      const username = yield* name.submitName('Jessica Miller');
      const terms = yield* username.submitUsername('jessica.miller.97');
      const decision = yield* terms.agree();
      if (decision._tag !== 'Created') return decision;
      const card = decision.firstScreen;
      const friends = yield* card.confirmProfileCard();
      const discover = yield* friends.skipFindingFacebookFriends();
      const email = yield* discover.skipDiscoverPeople();
      const reels = yield* email.skipAddingEmail();
      return yield* reels.skipReelsTuning();
    }),
});

phoneNumber, password and readCode are the placeholders above: the person's answers come from your own system (Create an account).

The pages of this site are the README files of the repository. The API reference is generated from the source.