@getcolo/colo-link
v1.0.4
Published
A library that generates a button for directing the user to the appropriate authorization url for the OAuth provider. Its purpose is to abstract away messy OAuth logic for React apps.
Downloads
2
Readme
colo-link
Install
yarn add @getcolo/colo-link
Usage
import React, { Component } from 'react'
import ColoLink from '@getcolo/colo-link'
import '@getcolo/colo-link/dist/index.css'
const App = () => {
return (
<ColoLink
scope={'calls:read calls:write'}
integration={'slack'}
userId={"your end-user's id"}
clientId={'oauth app client id'}
redirectUrl={'http://localhost:3000'}
/>
)
}
Component Reference
ColoLink
(without using https://getcolo.dev service)
integration
(required) - the provider you're integrating with e.g. 'slack'userId
(required) - the user id you're linking the request with (maps to thestate
value, which you can query on your callback handler to associate the retrieved access token with the sameuserId
)clientId
(required) - your OAuth app's client_idredirectUrl
(required) - the url of the callback handler i.e. where the user will be directed to after the authorization screenscope
(required) - the scopes your app is requesting that reflects the operations it will be able to perform against the end user.
(with https://getcolo.dev service)
integration
(required) - the provider you're integrating with e.g. 'slack'userId
(required) - the user id you're linking the request with (maps to thestate
value, which you can query on your callback handler to associate the retrieved access token with the sameuserId
)coloApiKey
(required) - the api key generated from your Colo application
License
MIT © getcolo