Socket
Socket
Sign inDemoInstall

@shopx/client

Package Overview
Dependencies
37
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @shopx/client

SHOPX Client API. Allows all basic functions on the API.


Version published
Maintainers
1
Created

Readme

Source

SHOPX Client API

@shopx/client MIT LICENSE @shopx/client Version

SHOPX Client API.

Installation:

$ yarn add @shopx/client graphql

API

This module exports a client function which takes following arguments.

Arguments
  • vendorID - Required - A string that specifies the shop. Can use "60e5185286ab2ff04f8cc576" as an example. This wil be sent to your email when you sign up. You can probably find this on console log of your store or admin panel, and on admin panel login page. You can also request this to be sent to you by contacting contact@shopxcommerce.com
  • authToken - Optional for accessing secure actions. Can be generated by await client("vendorID").new.login({ email: "", password: "" })
Example
import client from "@shopx/client"

const logProducts = async () => {
  const vendorID = "60e5185286ab2ff04f8cc576"
  const api = client(vendorID)
  console.log(await api.get.products())
}

logProducts() // List Products
Generating AuthToken Example
import client from "@shopx/client"

const { _id, token } = await client("vendorID").new.login({
  email: "",
  password: "",
})
const api = client("vendorID", token)
Full Usage Example
import client from "@shopx/client"

const logProducts = async () => {
  const { _id, token } = await client("vendorID").new.login({
    email: "",
    password: "",
  })
  const api = client("vendorID", token)
  console.log(await api.get.products())
}

logProducts() // List Products

License

@shopx/client MIT LICENSE MIT

Keywords

FAQs

Last updated on 04 Jan 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc