2.3.1 • Published 2 months ago

@doordeck/javascript-doordeck-sdk v2.3.1

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
2 months ago

Doordeck Javascript SDK

Getting started

  1. Install via npm

    $ npm install @doordeck/javascript-doordeck-sdk --save

Usage

import doordeckSdk from '@doordeck/javascript-doordeck-sdk'

// Initialise the SDK with your AuthToken
// 'AuthToken': Base64 encoded Ed25519 public key
// 'BaseUrl' : Base URL for the Doordeck SDK. If 'null' then the production URL is going to be used.

doordeckSdk.doordeckInit(authToken, baseUrl).then(response => {
	// doordeck successfully initialised
}, error => {
	if (error.state === 'verify') {
		// show verification screen
	} else {
		// catch error
	}
})


// Unlock device
// 'deviceId': id of the key you are sharing

doordeckSdk.device.unlock(deviceId)


// Get user and share key
// 'userEmailorId': email or userId of the person you want to share it with
// 'deviceId': id of the key you are sharing
// 'role': 'ADMIN' or 'USER'
// 'startDate/endDate': Unix Timestamp. For permanent key sharing set both to null.

doordeckSdk.device.getUser(userEmailorId).then(response => {
	var user = {'userId': response.data.user.id, 'publicKey': response.data.user.publicKey, 'email': response.data.email}
	Doordeck.device.share(deviceId, user, role, startDate, endDate)
})

Documentation

https://doordeck.com/developer

2.3.0

2 months ago

2.3.1

2 months ago

1.1.9

6 months ago

1.1.8

7 months ago

1.1.7

8 months ago

1.1.6

8 months ago

1.1.5

8 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.10

6 months ago

2.0.0

6 months ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

5 years ago