This is a barebones demo of the widget. It is intended to be used as a starting point for your own implementation.
To use the widget, you must include the loader script and call the
initBrandConnections
function.
The function takes two arguments:
options
- An object containing the following properties:
client_id
- Your client ID. This is provided to you by
your VA Brand Connections representative.
size
- Can have one of following: 'xs', 'small', 'medium', 'large'. Set size of default button. No value is equal to 'xs'.
connectText
- Custom text displayed on connect button. Note: all default styles removed when customized, following class added to button va-brand-connections-overridden.
disconnectText
- Custom text displayed on disconnect button. Note: all default styles removed when customized, following class added to button va-brand-connections-overridden.
loggedOut
- A logout callback function that is called when the
user is already logged out.
callback
- A callback function that is called when the
user's information is available. The function takes two arguments:
data
- An object containing the user's information and access token: {profile: {}, access_token:""}.
error
- A string containing an error message if
there was an error retrieving the user's information.
selector
- A string containing a CSS selector for the
element that the widget should be inserted into.
View this page's source to see the example code below. View browser console for output.