Class: Newton

Newton

Newton

Constructor

(private) new Newton()

Newton
Source:

Classes

SimpleObject

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.
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
Source:

finalizeLoginFlow(callback)

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

flowBegin(name, customDataopt)

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

flowCancel(name, customDataopt)

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

flowFail(name, customDataopt)

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

flowStep(name, customDataopt)

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

flowSucceed(nameopt, customDataopt)

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

flushEvents()

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

getLoginBuilder() → {LoginBuilder}

Return a login builder instance
Source:
Returns:
Type
LoginBuilder

getOAuthProviders() → {Array}

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

getUserMetaInfo(callback)

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

getUserToken() → {String}

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

isAnalyticFlowBegun() → {Boolean}

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

isLoginFlowRunning() → {Boolean}

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

isUserLogged() → {Boolean}

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

sendEvent(name, customDataopt)

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

setUserStateChangeListener(listener)

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

syncUserState(syncStateCallback)

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

timedEventStart(name, customDataopt)

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

timedEventStop(name, customDataopt)

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

userLogout()

Log the user out
Source: