Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DynamicContent

Amplience Dynamic Content API client.

Your application should avoid where possible creating a new client for each request. Authentication tokens are cached by the client and only re-requested when they expire, allowing performance to be improved by reusing the client across requests.

If multiple sets of credentials are required your application should create one client per credential set.

Example:

const client = new DynamicContent({
   client_id: process.env.CLIENT_ID,
   client_secret: process.env.CLIENT_SECRET
});

const repository = await client.contentRepositories.get('<REPO-ID>');

const contentItem = new ContentItem();
contentItem.label = 'Homepage Article';
contentItem.body = {
     _meta: {
         schema: "https://github.com/techiedarren/dc-examples/blob/master/content-types/blocks/text-block.json"
     },
     paragraphs: [
         "Example article text..."
     ]
};

await repository.related.contentItems.create(contentItem);

Hierarchy

  • DynamicContent

Index

Constructors

constructor

  • Creates a Dynamic Content API client instance. You must provide credentials that will be used to authenticate with the API.

    Parameters

    • authCredentials: Partial<AuthorizationConfig>
    • Optional dcConfig: DynamicContentConfig

      Optional configuration settings for Dynamic Content

    • Optional httpClient: AxiosRequestConfig | HttpClient

      Optional request settings, can be used to provide proxy settings, add interceptors etc

    Returns DynamicContent

Methods

Protected createResourceClient

Protected createTokenClient

Object literals

Readonly contentItems

contentItems: object

Content Item Resources

get

Readonly contentRepositories

contentRepositories: object

Content Repository Resources

get

Readonly contentTypeSchemas

contentTypeSchemas: object

get

getByVersion

Readonly contentTypes

contentTypes: object

Content Type Resources

get

Readonly editions

editions: object

Edition Resources

get

  • get(id: string): Promise<Edition>

Readonly events

events: object

Event Resources

get

  • get(id: string): Promise<Event>

Readonly extensions

extensions: object

Extension Resources

get

Readonly folders

folders: object

get

  • get(id: string): Promise<Folder>

Readonly hierarchies

hierarchies: object

Hierarchy Resources

children

children: object

get

parents

parents: object

get

Readonly hubs

hubs: object

Hub Resources

get

  • get(id: string): Promise<Hub>
  • Retrieve a hub resource by id

    Parameters

    • id: string

      hub id, previously generated on creation

    Returns Promise<Hub>

list

Readonly snapshots

snapshots: object

Snapshot Resources

get

Readonly workflowStates

workflowStates: object

Workflow States

get

Generated using TypeDoc