Appearance
Authorization
Important
Authorization is done from the clingInstance
, not the Cling import:
jsx
import Cling from '@cling-se/widget'
// The Cling instance is also available on "window.Cling"
const clingInstance = await Cling.init({ environment: env })
await clingInstance.auth({
method: 'authToken',
authToken: 'abc...'
})
// Classes that requires authorization are now ready for use
const myDoc = await clingInstance.document.get('abc123...')
Testing options
For testing purposes the widget can be authenticated with standard email/password. Create a test account at https://app.dev.cling.se/register if you don’t have one.
jsx
await Cling.auth({
method: 'standard',
email: '<EMAIL>', // replace with email
password: '<PASSWORD>' // replace with password
})
Partner connection
Partner connection with Cling can be used in order create and authenticate your users within Clings platform. For setup and usage please see: Partner routes
Authenticate user
With partner connection you can generate an authToken
ie. authorization code for your users account on Cling. As per: 3. Authenticate user
jsx
await Cling.auth({
method: 'authToken',
authToken: 'abc...'
})