@adhese/sdk-gambit
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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));

Readme

Keywords

none

Package Sidebar

Install

npm i @adhese/sdk-gambit

Weekly Downloads

12

Version

1.0.0

License

GPL-3.0

Unpacked Size

55.5 kB

Total Files

21

Last publish

Collaborators

  • adhese-ci
  • mefjush
  • tsturtew