JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q57122F
  • License ISC

Unofficial Wix Data API. Uses HTTP requests to connect.

Package Exports

  • uo-wix-data
  • uo-wix-data/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (uo-wix-data) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

About

This is an unofficial NPM Package which includes some functions from the Wix Data API by Wix. The purpose of this package is to use Wix Data (database collections) in a different environment (site or Node.js app). It uses HTTP requests to connect to Wix.

Installation

npm install uo-wix-data --save

Check documentaiton for more steps.

Documentation

On your wix site create a backend file called http-functions.js and inside it put the code that is in uowd-http.js.

Getting started

1. Create a Wix site (blank template) and enable Developer mode.

2. On your wix site create a backend file called http-functions.js (if not created already) and inside it put the code from uowd-http.js.

3. In const wdToken = "foobar"; replace foobar with your secret token.

4. On your Node.JS file import uo-wix-data with const wixData = require("uo-wix-data") and set up wixData.setup("username", "my-site", "token") replacing username with your wix username, my-site with your site name and token with your secret token.

UO Wix Data functions

  • setup(username, siteName, token) - Sets everything up.
  • enableDevMode(void) - Sends requests to published site.
  • disableDevMode(void) - Sends requests to saved site.

Example:

const wixData = require("uo-wix-data");
wixData.setup("username", "my-site", "foobar");

// Example
wixData.query("Users").eq("name", "John").find().then((result) => {
    console.log(result.items[0]);
});

Version 2.0.0

  • Added new functions:
    • bulkInsert
    • bulkUpdate
    • bulkRemove
    • query.include
    • query.count
    • enableDevMode
    • disableDevMode
  • Changed some error messages:
    • type_invalid to invalid_type
    • token_invalid to invalid_token
    • query_type_invalid to invalid_query_type
    • query_failed to find_failed