objy-connect

0.0.61 • Public • Published

OBJY Connect

The mapper can be used as OBJY storage for interacting with OBJY platform. Just define your object wrappers and use the connect mapper for storage.

Documentation

Find the full documentation at objy.xyz.

Install

Browser

<script src="https://cdn.jsdelivr.net/npm/objy/dist/browser.js" />
<script src="https://cdn.jsdelivr.net/npm/objy-connect/index.js" />

Node

npm i objy objy-connect --save

Usage

With ES6:

import CONNECT from "objy-connect";

With CommonJS:

var CONNECT = require('objy-connect')

With <script src="...">, the CONNECT object will be available automatically.

let remote = new CONNECT(OBJY);
remote.connect({client: "myclient", url: "https://mydomain.com/api"})

OBJY.define({
	name: "object",
	pluralName: "objects",
	storage: new CONNECT(OBJY).connect({client: "myclient", url: "https://mydomain.com/api"}),
	templateFamily: null // important
});

// Login
remote.login({username: "user", password: "***"}, () => {
	OBJY.objects({}).get(data => {
		console.log('data:', data)
	}, err => {
		console.log('err:', err)
	})
})

/objy-connect/

    Package Sidebar

    Install

    npm i objy-connect

    Weekly Downloads

    28

    Version

    0.0.61

    License

    ISC

    Unpacked Size

    20 kB

    Total Files

    4

    Last publish

    Collaborators

    • marcoboelling