@edgible-team/sdk
    Preparing search index...

    Class UsersClient

    User account CRUD and the user→organizations read.

    Index

    Constructors

    • Parameters

      • call: Caller

        authed Caller for the user-scoped endpoints.

      • callPublic: Caller

        auth-less Caller for the public signup endpoints (create, getSignupChallenge) — a brand-new user has no credentials yet, so registration must not run credential resolution.

      Returns UsersClient

    Methods

    • Fetch the proof-of-work signup challenge a visitor must solve before calling UsersClient.create. Public route — sent without authentication, since the caller is a pre-signup visitor with no credentials.

      The result is discriminated on enabled: when the backend stage has no challenge secret configured the mechanism is entirely off and the caller proceeds straight to create with no challenge fields.

      Parameters

      Returns Promise<SignupChallengeResponse>

      const res = await client.users.getSignupChallenge();
      if (res.enabled) {
      const solution = solve(res.challenge); // caller-side proof of work
      await client.users.create({
      email, termsAccepted: true,
      challengeToken: res.challenge.token,
      challengeSolution: solution,
      hpWebsite: '',
      });
      } else {
      await client.users.create({ email, termsAccepted: true });
      }

      ServerError if the route reports the challenge enabled but omits the challenge body — an unusable response, never silently downgraded to the disabled arm.

    • List the organizations the user is a member of.

      Parameters

      Returns Promise<OrganizationData[]>

    • Update a user; returns the updated row.

      Parameters

      Returns Promise<UserData>

      NotFoundError if the user does not exist.