1.0.0 • Published 1 year ago

@adhese/sdk-gambit v1.0.0

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
1 year ago

Gambit

For developers who want to use the Adhese SDK and used to work with Gambit configuration this package offers utility functions to convert Gambit configuration to Adhese configuration.

Installation

npm install @adhese/sdk-gambit

toOptions

Converts GambitConfig to AdheseOptions.

import { toOptions } from '@adhese/sdk-gambit';
import { createAdhese } from '@adhese/sdk';

const gambitConfig = {
  account: 'your-account-id',
  slots: {
    'slot-name': {
      id: 'slot-id',
      sizes: [
        {
          width: 300,
          height: 250,
        },
      ],
    },
  },
};

const adhese = createAdhese(toOptions(gambitConfig));

toParameters

Converts GambitData to Parameters.

import { toParameters } from '@adhese/sdk-gambit';
import { createAdhese } from '@adhese/sdk';

const gambitData = {
  'key1': 'value1',
  'key2': 'value2',
};

const parameters = toParameters(gambitData, {
  'k1': 'key1',
  'k2': 'key2',
});

const adhese = createAdhese({
  account: 'your-account-id',
  parameters,
});

toSlotOptions

Converts GambitSlot to AdheseSlot.

import { toSlotOptions } from '@adhese/sdk-gambit';

const gambitSlot = {
  slotType: 'slot-id',
  containerId: 'container-id',
};

adheses.addSlot(toSlotOptions(gambitSlot));
1.0.0

1 year ago

0.2.14

1 year ago

0.2.13

1 year ago

0.2.12

1 year ago

0.2.11

1 year ago

0.2.10

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.1.2

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago