@bachman-dev/wanikani-api-types - v2.0.0
    Preparing search index...

    Interface User

    A user and their status/information on WaniKani.

    interface User {
        data: {
            current_vacation_started_at: null | DatableString;
            id: string;
            level: Level;
            preferences: UserPreferences;
            profile_url: string;
            started_at: DatableString;
            subscription: {
                active: boolean;
                max_level_granted: Level;
                period_ends_at: null | DatableString;
                type: "free" | "lifetime" | "recurring" | "unknown";
            };
            username: string;
        };
        data_updated_at: DatableString;
        object: "user";
        url: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    data: {
        current_vacation_started_at: null | DatableString;
        id: string;
        level: Level;
        preferences: UserPreferences;
        profile_url: string;
        started_at: DatableString;
        subscription: {
            active: boolean;
            max_level_granted: Level;
            period_ends_at: null | DatableString;
            type: "free" | "lifetime" | "recurring" | "unknown";
        };
        username: string;
    }

    Data for the returned user.

    Type declaration

    • current_vacation_started_at: null | DatableString

      If the user is on vacation, this will be the timestamp of when that vacation started. If the user is not on vacation, this is null.

    • id: string

      A user's unique ID string.

    • level: Level

      The current level of the user. This ignores subscription status.

    • preferences: UserPreferences

      User settings specific to the WaniKani application.

    • profile_url: string

      The URL to the user's public facing profile page.

    • started_at: DatableString

      The signup date for the user.

    • subscription: {
          active: boolean;
          max_level_granted: Level;
          period_ends_at: null | DatableString;
          type: "free" | "lifetime" | "recurring" | "unknown";
      }

      Details about the user's subscription state.

      • active: boolean

        Whether or not the user currently has a paid subscription.

      • max_level_granted: Level

        The maximum level of content accessible to the user for lessons, reviews, and content review. For unsubscribed/free users, the maximum level is 3. For subscribed users, this is 60.

        Any application that uses data from the WaniKani API must respect these access limits.

      • period_ends_at: null | DatableString

        The date when the user's subscription period ends. If the user has subscription type lifetime or free then the value is null.

      • type: "free" | "lifetime" | "recurring" | "unknown"

        The type of subscription the user has. Options are following: free, recurring, and lifetime. A type of unknown means the user subscription state isn't exactly known. This is a weird state on WaniKani, should be treated as free, and reported to the WaniKani developers.

    • username: string

      The user's username.

    data_updated_at: DatableString

    For a resource, this is the last time that particular resource was updated.

    object: "user"

    The kind of object returned.

    url: string

    The URL of the requested resource.