Account

    Account


    Article summary


    title: Account

    version: 1.0.0
    layout: default
    sdk: manage

    # Account Module

    Version Account 1.0.0

    Table of Contents

    Usage

    To use the Account module, you can import it into your project from the Firebolt SDK:

    import { Account } from '@firebolt-js/manage-sdk'
    

    Overview

    A module for querying about the device account.

    Methods

    session

    Used by a distributor to push Session token to firebolt.

    function session(token: string, expiresIn: number): Promise<void>
    

    Parameters:

    ParamTypeRequiredDescription
    tokenstringtrue
    ,expiresInnumbertrue

    Promise resolution:

    void
    

    Capabilities:

    RoleCapability
    managesxrn:firebolt:capability:token:account

    Examples

    Default Example

    JavaScript:

    import { Account } from '@firebolt-js/manage-sdk'
    
    Account.session("RmlyZWJvbHQgTWFuYWdlIFNESyBSb2NrcyEhIQ==", 84000)
        .then(result => {
            console.log(result)
        })
    

    Value of result:

    null
    
    JSON-RPC:Request:
    {
    	"jsonrpc": "2.0",
    	"id": 1,
    	"method": "Account.session",
    	"params": {
    		"token": "RmlyZWJvbHQgTWFuYWdlIFNESyBSb2NrcyEhIQ==",
    		"expiresIn": 84000
    	}
    }
    

    Response:

    {
    	"jsonrpc": "2.0",
    	"id": 1,
    	"result": null
    }
    

    Types

    Token

    Encoded token provided by the Distributor for Device Authentication.

    type Token = string
    

    Expiry

    Number of secs before the token expires

    type Expiry = number
    


    Was this article helpful?