4.24.1 • Published 10 days ago

@code.store/arcxp-sdk-ts v4.24.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 days ago

arcxp-sdk-ts

A strongly typed set of ArcXP API's and utilities reduce the amount of work required to develop with ArcXP, starting with reducing the boilerplate code you have to write.

Installation

Install the package with:

npm i @code.store/arcxp-sdk-ts

Features

API

  • Author
  • Draft
  • Identity
  • IFX
  • Redirect
  • Migration Center
  • Sales
  • Site
  • Websked
  • Retail Events (WebSockets)
  • Content
  • Signing Service
  • PhotoCenter
  • Global Settings
  • Tags
Usage example
import { ArcAPI } from '@code.store/arcxp-sdk-ts';

const api = ArcAPI({
  credentials: { organizationName: 'YOUR_ORG_NAME', accessToken: 'YOUR_ACCESS_TOKEN' },
  maxRPS: 10,
});
const id = await api.Draft.generateId(Date.now().toString());

Content Elements

  • text
  • header
  • image
  • quote
  • interstitial_link
  • raw_html
  • gallery
  • list
  • link_list
  • jwPlayer
Usage example
import { ContentElement } from '@code.store/arcxp-sdk-ts';

const header = ContentElement.header('Header', 4);
const text = ContentElement.text('text');

Image migration example

import { ArcTypes, ArcAPI } from '@code.store/arcxp-sdk-ts';

const api = ArcAPI({
  credentials: { organizationName: 'YOUR_ORG_NAME', accessToken: 'YOUR_ACCESS_TOKEN' },
  maxRPS: 10,
});
const sourceImageId = 'sourceImageId';
const id = await api.Draft.generateId(sourceImageId);
const ans: ArcTypes.Story.AnImage = {
  _id: id,
  description: { basic: 'Description' },
  caption: 'Caption',
  subtitle: 'Subtitle',
  alt_text: 'Alt',
  type: 'image',
  version: '0.10.9',
  image_type: 'photograph',
  source: {
    name: 'codestore-arcxp-sdk-ts',
    system: 'codestore-arcxp-sdk-ts',
    source_id: sourceImageId,
  },
  additional_properties: {
    originalName: 'originalName',
    version: 0,
    originalUrl: 'https://picsum.photos/200',
    published: true,
  },
};

await api.MigrationCenter.postAns(
  {
    website: 'YOUR_WEBSITE',
    groupId: 'images',
    priority: 'historical',
  },
  {
    sourceId: sourceImageId,
    sourceType: 'image',
    ANS: ans,
  }
);

Changeset

npx changeset && npx changeset version

License

MIT

4.24.1

10 days ago

4.24.0

13 days ago

4.23.0

1 month ago

4.23.1

1 month ago

4.22.0

2 months ago

4.21.1

2 months ago

4.21.0

2 months ago

4.20.0

3 months ago

4.19.0

3 months ago

4.18.1

3 months ago

4.17.0

3 months ago

4.18.0

3 months ago

4.16.0

4 months ago

4.16.1

4 months ago

4.15.0

4 months ago

4.14.2

4 months ago

4.14.1

4 months ago

4.14.0

4 months ago

4.13.0

5 months ago

4.11.0

5 months ago

4.12.0

5 months ago

4.10.0

6 months ago

4.9.0

6 months ago

4.8.0

6 months ago

4.7.0

6 months ago

4.6.3

6 months ago

4.6.2

6 months ago

4.6.1

7 months ago

4.6.0

7 months ago

4.5.1

7 months ago

4.5.0

7 months ago

4.4.0

7 months ago

4.3.0

7 months ago

4.2.1

7 months ago

4.2.0

7 months ago

4.1.1

7 months ago

4.1.0

7 months ago

4.0.1

8 months ago

4.0.0

8 months ago

3.2.0

8 months ago

3.1.0

8 months ago

3.0.1

8 months ago

3.0.0

8 months ago

2.0.3

8 months ago

2.0.2

8 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.1.0

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago