1.0.25 • Published 10 months ago

@goshops/gs-sdk v1.0.25

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

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.

1.0.25

10 months ago

1.0.24

10 months ago

1.0.2-3.1

10 months ago

1.0.1-2.2

10 months ago

1.0.1-2.1

10 months ago

1.0.1-1.1

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago