initialSignup method

Future<TInitialSignupResponse> initialSignup({
  1. required TInitialSignupBody input,
})

Submit email for signup. Backend auto-detects if account exists and adjusts token type accordingly. Response is always {ok:true}.

Sign the provided TInitialSignupBody with the client's stamp function and submit the request (POST /public/v1/initial_signup).

See also: stampInitialSignup.

Implementation

Future<TInitialSignupResponse> initialSignup({
  required TInitialSignupBody input,
}) async {
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_INITIAL_SIGNUP',
  );
  return await request<Map<String, dynamic>, TInitialSignupResponse>(
      "/public/v1/initial_signup",
      body,
      (json) => TInitialSignupResponse.fromJson(
          transformActivityResponse(json, 'InitialSignup')));
}