nexkey

node sdk for nexkey's awesome lock product

MIT License

Downloads
28
Stars
3
Committers
3

nexkey

Javascript SDK for Nexkey's awesome lock product

including

import nexkey from 'nexkey'  // modern es modules approach

// *OR*

const nexkey = require('nexkey') // commonjs (node) approach

basic usage

const client = nexkey({
  // api credentials from nexkey beta
  NEXKEY_API_SECRET: process.env.NEXKEY_API_KEY,
  NEXKEY_API_KEY: process.env.NEXKEY_API_KEY
})


// phone and email are optional but you must send at least one
const phone = '5551236789'
const email = '[email protected]'
const result = await client.sendKey({ phone, email })

staging

to access nexkey's staging API, pass an ENVIRONMENT property, like this:

const client = nexkey({

  ENVIRONMENT: 'STAGING',

  // api credentials from nexkey beta
  NEXKEY_API_SECRET: process.env.NEXKEY_API_KEY,
  NEXKEY_API_KEY: process.env.NEXKEY_API_KEY
})

// use client normally here...

see https://api.nexkey.com/documentation for full details on the endpoints available.