Global

Members

ErrorCode :string

Enum encompassing all potential error codes in Now4real.

Properties:
Name Type Description
ABORTED string

Occurs when the authentication flow has been interrupted before its conclusion.

see AbortedError

ALREADY_PRESENT string

It occurs when attempting to create a new poll within a specific Page context, but there is already an active one present within it.

see AlreadyPresentError

ALREADY_REPORTED string

It happens when the currently authenticated user tries to report a message that they had previously reported.

see AlreadyReportedError

ALREADY_STARTED string

It occurs when a new authentication flow is requested, but there is already one in progress.

see AlreadyStartedError

BLOCKED string

When calling the login method, it occurs when the browser blocks the authentication popup, thus preventing the process from proceeding.

When calling the post method, instead, it happens when the message cannot be posted as it is considered offensive.

see BlockedError

CANNOT_MODERATE string

It occurs when the message cannot be posted due to a malfunction in the automatic moderation system. A new attempt to call the method should be done later.

see CannotModerateError

CHATBOT string

It occurs when the message cannot be posted due a failure in the configured chatbot webhook.

see ChatbotError

CHAT_DISABLED string

Occurs when the post method has been called on a disabled pagechat.

see ChatDisabledError

CLOSED string

It occurs when attempting to submit a vote in a currently closed poll.

see ClosedError

CREDIT_EXHAUSTED string

It occurs during script loading when it is detected that the credit for the site has been exhausted, and the site has therefore been blocked, or if Now4real has been explicitly disabled on the current site by the administrator."

DISCONNECTED string

Occurs when the client is not connected to the Now4real cloud (usually because it is offline) but the called method requires a connection.

see DisconnectedError

INVALID_ARGUMENTS string

Occurs when the arguments passed to a method are either invalid or malformed.

see InvalidArgumentsError

INVALID_CALL string

Occurs when a method has been called but could not be called.

see InvalidCallError

MISMATCH string

It occurs during script loading when a mismatch is detected between the authentication type set for the current site and the script configuration.

For example, the site may be configured to work with "Social and email login", "No registration", or "Email login", but custom authentication is set up in the script. Alternatively, "JWT authentication" may be configured, but custom authentication is not present in the script configuration.

NOT_AUTHENTICATED string

Occurs when there is no currently signed in user but the called method requires a successfully authenticated user.

see NotAuthenticatedError

NOT_AUTHORIZED string

Occurs when the current user is not authorized to call a method.

see NotAuthorizedError

NOT_FOUND string

It happens when the called method requires an active poll, but is not present in the current Page context.

see NotFoundError

SERVICE_UNAVAILABLE string

Occurs when the Now4real cloud failed to respond. A new attempt to call the method should be done later.

see ServiceUnavailableError

TECHNICAL_PROBLEM string

Occurs when there was an unexpected error during the execution of an operation.

see TechnicalProblemError

TOO_FREQUENT string

Occurs when the post method has been called before the waitPeriod has passed.

see TooFrequentError

USER_MUTED string

Occurs when a method has been called on behalf of a muted Now4real user in the current pagechat.

see UserMutedError

Subject :string

Enum representing subscribable subjects in Now4real.

Properties:
Name Type Description
CONNECTION_STATUS string

Notifies the application when there was a change in the status of the connection between the client and the Now4real cloud.

see ConnectionStatusUpdate

LOGIN_STATUS string

Notifies the application when there was a login or a logout of a Now4real user in the current browser.

see LoginStatusUpdate

PARAMETERS string

Receives the chat configuration parameters.

see ParametersUpdate

AUTHORIZATION string

Receives the site authorization map.

see AuthorizationUpdate

LIST_CHAT_MESSAGES string

Receives the messages posted to the current pagechat.

see MessageListUpdate

LIST_CHAT_TYPING string

Notifies the application when a Now4real user has started or stopped typing a message for the current pagechat.

see TypingListUpdate

COUNTER_PAGE_CHATTERS string

Receives updates to the counter of chatters in the current Page Context.

see CounterUpdate

COUNTER_PAGE_VIEWERS string

Receives updates to the counter of viewers in the current Page Context (page presence counter).

see CounterUpdate

COUNTER_SITE_CHATTERS string

Receives updates to the counter of chatters in the current Site Context.

see CounterUpdate

COUNTER_SITE_VIEWERS string

Receives updates to the counter of viewers in the current Site Context (site presence counter).

see CounterUpdate

COUNTER_CHAT_MESSAGES string

Receives updates to the counter of all the messages available in the current pagechat.

see CounterUpdate

COUNTER_CHAT_TYPING string

Receives updates to the counter of all the users who are typing a message for the current pagechat.

see CounterUpdate

RANKING_PAGE_CHATTERS string

Receives ranking updates of the top pages of the site by number of chatters.

see RankingUpdate

RANKING_PAGE_VIEWERS string

Receives ranking updates of the top pages of the site by number of viewers (presence).

see RankingUpdate

HEATMAP_PAGE_VIEWERS string

Receives heatmap updates of the geographical distribution of the viewers in the current Page Context.

see HeatmapUpdate

HEATMAP_SITE_VIEWERS string

Receives heatmap updates of the geographical distribution of the viewers in the current Site Context.

see HeatmapUpdate

POLL_STATUS string

Receives updates regarding the status of the poll eventually present in the current Page context. [Not in Free Plan]

see PollStatusUpdate

POLL string

Receives updates regarding the poll eventually present in the current Page context. [Not in Free Plan]

see PollUpdate

Type Definitions

CurrentUser :User

Object that represents the current logged-in Now4real user. It extends the User object with some additional properties.

Properties:
Name Type Description
consentGiven boolean

Indicates whether the user has accepted Now4real's Terms of Service and Privacy Policy.

PollAnswer :Object

Properties:
Name Type Description
text string

The text of the answer.

percentage number

The percentage of votes for this answer.

User :object

Object that represents a Now4real user.

Properties:
Name Type Attributes Description
id string

The unique identifier of the user.

name string

The name of the user on the social network or on the site in the case of custom authentication.

pic string

The URL of the user profile image on the social network or on the site in case of custom authentication.

provider string

The login provider used for authentication. It can be "JWT" in case of custom authentication, "NO_REGISTRATION" for authentication without registration, "EMAIL", "CHATBOT" for chatbots' authentication, or one of the supported social providers: "FACEBOOK", "GOOGLE", "LINKEDIN", or "TWITTER" (for backward compatibility, we still use the string "TWITTER" even if that platform has been rebranded to X).

role string <optional>

The role that the user assumes in the current pagechat, as configured in the Dashboard. It can be "GUEST" or "MODERATOR".

badge object <optional>

The badge for the user, as configured in the Dashboard.

Properties
Name Type Description
label string

The configured text label.

textColor string

The configured text color, in the hexadecimal format.

backgroundColor string

The configured backgound color, in the hexadecimal format.