fexr

API Client for all Fexr services

Usage no npm install needed!

<script type="module">
  import fexr from 'https://cdn.skypack.dev/fexr';
</script>

README

fexr-js

Fexr API Client for node based services.

Node.js Package

Read about notifications, publishing a shortcut and more API in official docs

Installing

npm i --save fexr

or

yarn add fexr

Add your Fexr credentials

Create new file fexr.json in the root

/src/fexr.js:

import Fexr from 'fexr'

const fexr = new Fexr({
  botEmail: '.............',
  botPassword: '.............',
  usageId: 'F0-xxx-bio',
});

fexr.initializeApp();

export default fexr;

Later import to other files: Based on the folder structure,

import fx from "../fexr";

or

import fx from "./fexr";

Get new unique tracking code linked to your usageId

Tracking codes are used to provide connected services and analytics across platforms. Store this code for future usecases once generated using newCode()

fx.newCode().then((res) => {
    console.log("code: ", res.trackingCode);
});

To set properties for the code (Used for QR Scan responses)

fx.newCode({
    "identifier": 01,
    "message": "thank you for scanning" //optional key-value pair data
}).then((res) => {
    console.log("code: ", res.trackingCode);
});

Sync a new piece of data

from json metadata

fx.enableSync({
    "string": "form-widget",
    "object": {},
    ...
    });

from json file

fx.enableSync({
    "/local/data.json"
});

to not share sync data with any members

by default private is set to false.

fx.enableSync(
    "/local/data.json", 
    "filename", //filename
    true, // required for startup
    true, //is data private (only visible to you in the usage)
    [1,2,3], //role IDs of people who can read, if not mentioned, evey members will be able to read
    [1,2,3] //role IDs of people who can write / update this data, if not mentioned, evey members will be able to write
);

Fetch latest sync files

shared sync files will be saved locally

fx.sync();

Disable updates for a sync you published

fx.disableSync(sync_id);

Notifications, publishing a shortcut and more API in official docs

FAQ


License

(The MIT License)

Copyright (c) Fexr support@getfexr.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Changelog

0.3

  • newCode
  • enableSync
  • disableSync