0.0.28 • Published 4 years ago

@plade/sdk v0.0.28

Weekly downloads
18
License
MIT
Repository
gitlab
Last release
4 years ago

Plade Javascript sdk

Installation

yarn add @plade/sdk

Usage

To get started, instantiate a new Plade client with your store credentials.

Note: This may require a Plade account.

// JavaScript
import { gateway as PladeGateway } from '@plade/sdk'

const Plade = PladeGateway({
  clientId: 'XXX'
})
// Node.js
const PladeGateway = require('@plade/sdk').gateway

const Plade = PladeGateway({
  clientId: 'XXX',
  clientSecret: 'XXX'
})

Note: If you're using webpack, you'll need to add the following to your projects configuration file.

{
"node": {
      "fs": "empty"
    }
}

Custom Storage

By default the Plade SDK persists data to window.localStorage in the browser and node-localstorage in Node. If this doesn't suit your needs you can override the default storage with a MemoryStorageFactory which will persist data for the life cycle of the JavaScript VM:

import { gateway as PladeGateway, MemoryStorageFactory } from '@plade/sdk'

const Plade = PladeGateway({
  clientId: 'XXX',
  storage: new MemoryStorageFactory()
});

Or alternatively, create your own storage factory by passing in an object which implements the following interface:

interface StorageFactory {
  set(key: string, value: string): void;
  get(key: string): string | null;
  delete(key: string): void;
}
0.0.20

4 years ago

0.0.21

4 years ago

0.0.22

4 years ago

0.0.23

4 years ago

0.0.24

4 years ago

0.0.25

4 years ago

0.0.26

4 years ago

0.0.27

4 years ago

0.0.28

4 years ago

0.0.17

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3-beta.8

6 years ago

0.0.3-beta.7

6 years ago

0.0.3-beta.6

6 years ago

0.0.3-beta.5

6 years ago

0.0.3-beta.4

6 years ago

0.0.3-beta.3

6 years ago

0.0.3-beta.2

6 years ago

0.0.3-beta.1

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago