nexkey

0.6.0 • Public • Published

nexkey

Build Status

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 = 'john.doe@test.com'
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 = 'john.doe@test.com'
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.

Readme

Keywords

none

Package Sidebar

Install

npm i nexkey

Weekly Downloads

2

Version

0.6.0

License

MIT

Unpacked Size

15.1 kB

Total Files

14

Last publish

Collaborators

  • mreinstein
  • retzion