nexkey
v0.6.0
Published
javascript sdk for nexkey's awesome lock product
Downloads
8
Readme
nexkey
Javascript SDK for Nexkey's awesome lock product
commonjs (node) usage
const nexkey = require('nexkey')
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 })
es module usage
import nexkey from 'nexkey'
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.