Newton

Newton

Newton

Constructor

(private) new Newton()

Newton
Source:

Classes

SimpleObject

Namespaces

RankingScope

Methods

(static) getEnvironmentString() → {String}

Get the environment string representation
Source:
Returns:
Type:
String

(static) getSharedInstance() → {Newton}

Get the shared instance
Source:
Throws:
- Throw if getSharedInstanceWithConfig hasn't been called
Type
Error
Returns:
Type:
Newton

(static) getSharedInstanceWithConfig() → {Newton}

Get the shared instance. Create one if no sharedInstance found
Source:
Throws:
- Throw if no secret is given
Type
Error
Returns:
Type:
Newton

(static) getVersionString() → {String}

Get current Newton version
Source:
Returns:
Type:
String

__temporaryUserDelete(userDeleteCallback)

Delete the current user.
Source:
Parameters:
Name Type Description
userDeleteCallback UserDeleteCallback The callback invoked when the request is done. It has an error if the request couldn't be completed

confirmEmail(confirmToken, callback)

Start the confirm identity flow. Call the callback with the result
Source:
Parameters:
Name Type Description
confirmToken The token from the email
callback The callback invoked at the end with the status (undefined or error)

finalizeLoginFlow(callback)

Finalize login flow. Used only for customized waiting page
Source:
Parameters:
Name Type Description
callback function invoked at the end of the flow. An error is given to discern the error case

flowBegin(name, customDataopt)

Begin a flow. Close a previous flow with a fail if need.
Source:
Parameters:
Name Type Attributes Description
name String The name of the flow
customData Newton.SimpleObject <optional>
Some data attached to this event

flowCancel(name, customDataopt)

End a flow with a cancellation
Source:
Parameters:
Name Type Attributes Description
name String The reason of the cancellation
customData Newton.SimpleObject <optional>
Some data
Throws:
Throw if there's not a begun flow

flowFail(name, customDataopt)

End a flow with a failure
Source:
Parameters:
Name Type Attributes Description
name String The reason of the failure
customData Newton.SimpleObject <optional>
Some data
Throws:
Throw if there's not a begun flow

flowStep(name, customDataopt)

Make a step for a flow
Source:
Parameters:
Name Type Attributes Description
name String The name of the step
customData Newton.SimpleObject <optional>
Some data attached to this event
Throws:
Throw if there's not a begun flow

flowSucceed(nameopt, customDataopt)

End a flow with a success
Source:
Parameters:
Name Type Attributes Default Description
name String <optional>
"ok" A name that identify the end
customData Newton.SimpleObject <optional>
Some data
Throws:
Throw if there's not a begun flow

flushEvents()

Force to flush all events - dummy method in javascript
Source:
Parameters:
Type Description
callback invoked asynchronously

getIdentityManager() → {IdentityManager}

Return a login builder instance
Source:
Returns:
Type:
IdentityManager

getLoginBuilder() → {LoginBuilder}

Return a login builder instance
Source:
Returns:
Type:
LoginBuilder

getOAuthProviders() → {Array}

Return a list of available and supported oauth provider
Source:
Returns:
Type:
Array
- the list

getUserMetaInfo(callback)

Retreive the user metainfo
Source:
Parameters:
Name Type Description
callback MetaInfoCallback

getUserToken() → {String}

Return the user token.
Source:
Returns:
Type:
String
- The user token

isAnalyticFlowBegun() → {Boolean}

Return true if a flow is begun (analytics)
Source:
Returns:
Type:
Boolean
- true if there is a begun flow

isLoginFlowRunning() → {Boolean}

Return true is a login flow is running
Source:
Returns:
Type:
Boolean
- true if a login flow is running

isTimedEventRunning(name) → {Boolean}

Return true if there is a running timed event with that name
Source:
Parameters:
Name Type Description
name String The name of the running timed event
Returns:
Type:
Boolean
- true if there is a running timed event with that name

isUserLogged() → {Boolean}

Return true if Newton User is logged
Source:
Returns:
Type:
Boolean
- true if Newton User is logged

rankContent(contentId, scope, multiplieropt)

Rank a content in a scope
Source:
Parameters:
Name Type Attributes Description
contentId String The contentId (at least 4 chars)
scope Newton.RankingScope The scope for this rank
multiplier Number <optional>
The multiplier for this rank
Throws:
Throw if the params are not correct

resetPassword(forgotToken, password, callback)

Start the reset password flow. Call the callback with the result
Source:
Parameters:
Name Type Description
forgotToken The token from the email
password The new password
callback The callback invoked at the end with the status (undefined or error)

sendEvent(name, customDataopt)

Queue a custom event
Source:
Parameters:
Name Type Attributes Description
name String The name of this event
customData Newton.SimpleObject <optional>
Some data attached to this event
Throws:
Will throw error if label is not valid or customData is a wrong type

setUserStateChangeListener(listener)

Notify the changing of the user status
Source:
Parameters:
Name Type Description
listener UserStateChangeListener

syncUserState(syncStateCallback)

Refresh the current local user state asking to the server the real user state
Source:
Parameters:
Name Type Description
syncStateCallback SyncStateCallback The callback invoked when the state is really refreshed

timedEventStart(name, customDataopt)

Start a timed event
Source:
Parameters:
Name Type Attributes Description
name String The name of the timed event
customData Newton.SimpleObject <optional>
Some data attached to this event

timedEventStop(name, customDataopt)

Stop a timed event
Source:
Parameters:
Name Type Attributes Description
name String The name of this event
customData Newton.SimpleObject <optional>
Some data attached to this event
Throws:
Throw if there's no started event the given name

userLogout()

Log the user out
Source: