- Overview
- Social Sign-in Widget
- User Registration Widget
- Social Sharing Widget
- Provider Setup Guide
- One-Click Sharing Widget
- Legacy Sign-in Widget
- Legacy Sharing Widget
Signin
Functions in the Sign-in category interact with the widget after it’s been launched. This can affect the state of the widget, or request information from the widget.
An example of a popular sign-in function is to launch a sign-in flow for a widget that’s been built without the use of the Dashboard. The widget’s design is coded into the webpage, and uses setProviderFlow or triggerFlow to initiate user authentication.
Usage
janrain.engage.signin
| Field | Description |
|---|---|
| modal | Object containing functions for manipulating modal widgets. |
| version | String specifying API version. |
| widget | Object containing functions for manipulating widget appearance. |
| debugDump | Send widget information to JavaScript console. |
| getState | Return current state of widget. |
| setBackplaneChannel | For Backplane enabled widgets. Sets the Backplane channel when the widget loads during user sign-in. If the channel isn’t loaded yet, the channel is set according to the widget settings. |
| setNoReturnExperience | Bypass the return experience. |
| setProviderFlow | Used for coding a custom designed Social Sign-in Widget. This allows a page element to begin the provider sign-in flow. See Customizing the Widget Appearance topic for more information. |
| triggerFlow | Used when coding a custom designed Social Sign-in Widget. Triggers the sign-in flow for a provider. See Customizing the Widget Appearance topic for more information. |
| appendTokenParams | Adds parameter information to the query string on the token URL. |
appendTokenParams ¶
Appends information to the end of the query string on the token URL after the widget has loaded. This is useful for adding information not addressed in the sign-in process. For example, a customer may want to append an ID they get from a cookie to the end of a URL.
NOTE:
- appendTokenParams is case sensitive.
- When called more than once, the new parameter replaces the parameter set before it. Incrementally adding parameters to the token URL is not supported at this time.
Usage
janrain.engage.signin.appendTokenParams({'param1': 'value1', 'param2': 'value2', 'param3': 'value3'});
debugDump ¶
Send the widget information to the JavaScript console.
Usage
janrain.engage.signin.debugDump()
The debugDump function logs a series of items to the JavaScript console. These include information about the browser, the web page, and the contents of the settings object.
If debugDump is unable to locate a JavaScript console, it returns false. Otherwise it returns true.
getState ¶
Return the current state of the widget object.
Usage
janrain.engage.signin.getState()
The getState function returns an object that describes the current state of the widget. Most fields in the object correspond to fields in the settings object.
Most fields correspond to parts of the widget configuration. For details on these features, refer to Configure the Widget.
| Field | Description |
|---|---|
| actionText | The text of the action. |
| backgroundColor | The background color of the widget, expressed as a hexadecimal value. For example: #ffffff |
| borderColor | The color of the widget’s borders, expressed as a hexadecimal value. For example: #ffffff |
| borderRadius | The radius of the curves on the corners of the widget. |
| buttonBackgroundStyle | The style of the button background. |
| buttonBorderColor | The color of the button borders, expressed as a hexadecimal value. For example: #ffffff |
| buttonBorderRadius | The radius of the curves on the corners of the buttons. |
| fontColor | The color of the font for the action text, expressed as a hexadecimal value. For example: #ffffff |
| fontFamily | Font family for the action text. |
| fontSize | Font size for the action text. |
| format | The button layout. |
| modalState | If the widget is modal, this field is an object containing information that is specific to the modal widget. The fields in this object are described below. |
| providers | Array of specifier strings for provider buttons. Possible strings are listed in Identity Providers. |
| providersPerPage | The number of provider buttons per widget page. |
| showAttribution | A boolean. True shows the attribution text, false hides the attribution text. |
| type | The widget type, whether it is modal or embedded. |
| width | The width of the widget, in pixels. |
modalState ¶
The modalState object, if present, contains the following fields.
| Field | Description |
|---|---|
| borderColor | The border color, expressed as a hexadecimal value. For example: #ffffff |
| borderOpacity | Border opacity. |
| borderRadius | Radius of border corners. |
| borderWidth | Border width. |
| orientation | Set when widget is used on a mobile device with orientation support to landscape or portrait. |
setNoReturnExperience ¶
Bypass the return experience.
Usage
janrain.engage.signin.setNoReturnExperience(value)
| Parameter | Required? | Description |
|---|---|---|
| value | yes | Boolean value. If true, the return experience form of the widget is bypassed and the user is presented with the usual new visitor choice of providers. If false, the function does nothing. |