Vault

Vault

new Vault(optsopt) → {Vault}

Class for initializing and integrating the Zippie Platform into an application. This class should be instantiated and setup in the main entry point of your code to properly handle signing a user in.

After calling setup(), you may query the instance property isSignedIn to check to see if the user was automatically signed in. If not, then the signin() method must be called to trigger the signin process.

It is good practice to build a button linked to the signin() process to work properly with browsers that have ITP 2.0 (Internet Tracking Prevention) support, like Safari and Firefox 65+

Parameters:
Name Type Attributes Description
opts Vault#VaultOpts <optional>

Vault API configuration.

Source:
Example
const vault = new Vault({vault_uri: 'https://vault.dev.zippie.org'})
vault.setup()
 .then(_ => vault.signin())
 .then(_ => {
   console.info('Vault initialized')
 })
 .catch(e => { console.error(e) })

Members

config :Object

Vault services configuration

Source:

isSignedIn :boolean

Indicates whether the vault is initialized and the user is successfully signed in with this application to their Zippie identity.

Source:

version :Vault#VersionInfo

Vault version information

Source:

Methods

getDeviceInfo() → {Vault#DeviceInfo}

Request this devices' identification information.

Source:

message(request) → {Promise}

Low-Level API which sends a raw request message to the vault enclave. Returns a promise that resolves or rejects depending on the received result.

Parameters:
Name Type Description
request Vault#Message

Message to send

Source:

setup()

Initialize the vault enclave by loading the vault into an iframe with a magiccookie key (if available). Resolves when the vault is ready for receiving messages.

This function may result in an automated signin, you can test for this by reading the isSignedIn property.

Source:

signin(optsopt, noLoginopt)

When vault is setup correctly, this function initiates a signin process, which should be called from an interactive user component, like a button to work correctly with browsers that have ITP 2.0 (Internet Tracking Prevention) support, like Safari and Firefox 65+

Parameters:
Name Type Attributes Description
opts Vault#SigninOpts <optional>

Options to pass to Vault during signin process.

noLogin bool <optional>

(internal use only)

Source:

Type Definitions

DeviceInfo :Object

The DeviceInfo type contains unique information associated with this device. Information like the devices unique ID is hashed with the application origin to stop developers from being able to track devices across different domains and applications.

Properties:
Name Type Description
deviceId string

Unique device ID

Source:

SigninOpts :Object

Properties:
Name Type Attributes Description
launch string <optional>

URI to redirect to after the signin process is completed.

Source:

VaultOpts :Object

Properties:
Name Type Description
vault_uri string

Specify custom vault location

Source:

VersionInfo :Object

Properties:
Name Type Description
BUILD_VERSION string

Vault build version

BUILD_TIMESTAMP string

Vault build timestamp

Source: