New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

kontenbase

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

kontenbase

Node.js client for Kontenbase API

  • 0.0.5
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Kontenbase API Node.js Client

npm

This is the Official Node JS API client/library for Kontenbase API. Visit https://kontenbase.com. More information about the product and see documentation at http://kontenbase.com/api for more technical details.

NPM

API Documentation

Please check Kontenbase API Reference.

Installation

Node.js

To install kontenbase in a node project:

npm install --save kontenbase

Kontenbase is compatible with Node 10 and above.

Usage

Configure package with your account's API key and userToken obtained from your Kontenbase Dashboard.

const  { KontenBaseClient } = require('kontenbase')

const kontenbase = new KontenBaseClient({
  apiKey: '*******************',
  token: ''
})

User Services

Use kontenbase auth services for manage your user/customer

Register

await kontenbase.user.register({
  firstName: 'lucky',
  lastName: 'axl',
  email: 'luckyaxl@gmail.com',
  password: 'strongpasswd',
  role: 'authenticated',
})

Response:
{ "token": "8868bcf9826f0****" }

Login

await kontenbase.user.login({
  email: 'luckyaxl@gmail.com',
  password: 'strongpasswd',
})

Response:
{ "token": "8868bcf9826f0****" }

Add User To Role

await kontenbase.user.addToRole({
  userId: '605a2115a1cedf3fxxxxxxxx',
  roleName: 'authenticated',
})

Remove User From Role

await kontenbase.user.removeFromRole({
  userId: '605a2115a1cedf3fxxxxxxxx',
})

Get Profile

await kontenbase.user.getProfile()

Record Services

Initiate Record service using table prototype that has been injected with your Table Name

const record = kontenbase.table("My Table");

Create Record

await record.create({
  Name: 'Axl',
  Notes: 'I Love You'
})

Response:

Get Record

await record.find()

Response: [
  {
    _id: '605a151e409d123bf33be5a9',
    Name: 'John',
    Notes: 'No Code',
  },
  {
    _id: '605a251d7b8678bf681f284e',
    Name: 'Jenny',
    Notes: 'Ready',
  },
]

Update Record

await record.update(recordId, {
  Name: 'Axl',
  Notes: 'Cool'
})

Response:
{ Name: 'Axl', Notes: 'Cool' }

Delete Record

await record.delete({
  id: '605a251d7b8678bf681f284e',
})

Response:

Interactive documentation

Go to https://kontenbase.com/api to see the interactive API documentation for your Kontenbase project. Once you select a project, click the "JavaScript" tab to see code snippets using Kontenbase. It'll have examples for all operations you can perform against your project using this library.

Keywords

FAQs

Package last updated on 29 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc