@goshops/gs-sdk

1.0.25 • Public • Published

Introduction

@goshops/gs-sdk is a JavaScript SDK that enables seamless integration with the GoShops platform.

Installation

You can install @goshops/gs-sdk package via npm:

npm install --save @goshops/gs-sdk

Alternatively, you can include it in your project using a script tag with the CDN link:

<script src="https://unpkg.com/@goshops/gs-sdk@latest"></script>

To specify a version change latest with the version number from https://www.npmjs.com/package/@goshops/gs-sdk?activeTab=versions

Usage

With npm:

You can import @goshops/gs-sdk in your JavaScript file:

import GSSDK from '@goshops/gs-sdk';

const gsSDK = new GSSDK('your-client-id');

With CDN:

If you included the SDK using the script tag, you can access the GSSDK constructor directly:

const gsSDK = new window.GSSDK('your-client-id');

In both cases, you can then use the GS SDK to call various methods:

gsSDK.login('userId')
  .then(response => {
    console.log(response);
  })
  .catch(error => {
    console.error(error);
  });

Or using async/await:

try {
  const response = await gsSDK.login('userId');
  console.log(response);
} catch (error) {
  console.error(error);
}

Note: Replace 'your-client-id' with your actual client ID.

Methods

@goshops/gs-sdk exposes the following methods:

  • login(userId)
  • logout()
  • addInteraction(interaction)
  • getContent(contentId)

Refer to the official API documentation for detailed information about these methods.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.25
    0
    • latest

Version History

Package Sidebar

Install

npm i @goshops/gs-sdk

Weekly Downloads

6

Version

1.0.25

License

none

Unpacked Size

35 kB

Total Files

12

Last publish

Collaborators

  • goshops