Skip to content

Instantly share code, notes, and snippets.

@anabellaspinelli
Created September 25, 2018 08:54
Show Gist options
  • Save anabellaspinelli/39961253bbef4d8fc6e5a273717fc804 to your computer and use it in GitHub Desktop.
Save anabellaspinelli/39961253bbef4d8fc6e5a273717fc804 to your computer and use it in GitHub Desktop.
bootstrap() {
const script = document.createElement('script')
script.src = 'https://public-assets.typeform.com/public/oauthbtn/btn.min.js'
script.type = 'text/javascript'
script.async = true
// script.onload = () => this.setState({loading: false});
const scriptConfig = {}
scriptConfig['name'] = 'tf-login-button'
scriptConfig['data-redirect_uri'] = 'https://www.tremendous.com/'
scriptConfig['data-scope'] = 'accounts:read+forms:write+forms:read+responses:read+webhooks:read+webhooks:write'
scriptConfig['data-state'] = ''
scriptConfig['data-client_id'] = 'clientIDclientIDclientIDclientIDclientIDclientID'
Object.keys(scriptConfig).forEach(key => script.setAttribute(key, scriptConfig[key]))
document.body.appendChild(script)
}
render() {
return (
<div>
<div className='py-5'>
<p>
To get started, we will need to first connect to your Typeform accounts
</p>
<div className='tf-login-button' />
</div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment