Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Latest commit

 

History

History
35 lines (23 loc) · 708 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 708 Bytes

Auth cloud-sdk

Javascript SDK to interact with BloqCloud accounts

Install

$ npm install --save @bloq/cloud-sdk
$ yarn add @bloq/cloud-sdk

Use

const { auth } = require('@bloq/cloud-sdk')

const clientId = 'CLIENT_ID'
const clientSecret = 'CLIENT_SECRET'

const client = auth({ clientId, clientSecret })

client.accessToken()
  .then(function (accessToken) {
    // Use access token
  })

API

client.accessToken()

This methods returns a promise that resolves in a new created access token using the provided client id and secret. The access token is required to interact with cloud services. It usually travels in an Authorization header value.