1.0.25 • Published 2 years ago

@goshops/gs-sdk v1.0.25

Weekly downloads
-
License
-
Repository
-
Last release
2 years 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

2 years ago

1.0.24

2 years ago

1.0.2-3.1

2 years ago

1.0.1-2.2

2 years ago

1.0.1-2.1

2 years ago

1.0.1-1.1

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago