Channels

channels

Introduction

Waylay provides OAuth2 based API integration using channels concept. When you connect to 3rd party OAuth2 using channel concept, waylay keeps, in secure way, access tokens to that app. Waylay makes sure that these tokens are always valid - which means that you don’t need to care about requesting new access tokens using refresh token. channels

In your sensor and actuation code, you can always access the token using waylay util package, as shown in this example below:

var user = waylayUtil.getProperty(options, "user") || "organisation"
    
waylayUtil.getAuthTokens(options, user, "googledrive")
.then(tokens => {
    var options = {
        url:"https://content-sheets.googleapis.com/v4/spreadsheets/"+ sheetId + "/values/" + range,
        auth:{
            'bearer': tokens.access_token
        }
    }
 ...

As you can see waylayUtil.getAuthTokens is a promise, while default user (organisation) to which we associate the channel (in this example googledrive).

Next to the channels, out of the box, we provide several default sensors and actuators for google sheet and google calendar.

B2C OAuth2 integration

Channels are great way to integrate B2B applications. Should you want to integrate OAuth2 based smart devices, such as NEST, philips Hue, netatmo, fitbit, homeconnect or similar (we have done 50+ integrations so far), please contact our professional service team at info@waylay.io