QuickNav
contentSDK
new contentSDK()
Methods
(static) createDeliveryClient(args) → {ContentDeliveryClient}
Create a delivery client to interact with content published
in Oracle Content Management. A delivery client can
- read published content items
- download published digital assets
- render published content using named content layouts
Parameters:
Name | Type | Description |
---|---|---|
args |
ClientParameters | A JavaScript object containing the parameters to create the content delivery client instance. |
Returns:
Example
import { contentSDK } from '@oracle/content-management-sdk';
// create a delivery client and output logging 'info' messages to the console
var deliveryClient = contentSDK.createDeliveryClient({
contentServer: contentServer,
channelToken: channelToken,
logger: {
info: function (message) {
console.log(message);
}
}
});
(static) createPreviewClient(args) → {ContentPreviewClient|ContentManagementClient}
Create a preview client to view draft (unpublished) content.
Preview clients can:
- read content types.
- read draft content items.
- render draft content using named content layouts.
- providing a beforeSend function to inject an Authorization header
- providing an Authorization header value via an authorization property of the arguments
- providing an authorizationParams object containing credentials to generate an OAuth token from the specified identity provider.
Parameters:
Name | Type | Description |
---|---|---|
args |
ClientParameters | A JavaScript object containing the parameters to create the content preview client instance. |
Returns:
Examples
import { contentSDK } from '@oracle/content-management-sdk';
// create a preview client (using preview REST API)
// and output logging 'info' messages to the console
var previewClient = contentSDK.createPreviewClient({
contentServer: contentServer,
channelToken: channelToken,
options: {
previewClientAPI: "previewREST",
},
authorizationParams: {
CLIENT_ID: "123456ABC",
CLIENT_SECRET: "7890123DEF",
CLIENT_SCOPE_URL: "https://<ServiceInstanceBaseURL>:443/urn:opc:cec:all",
IDP_URL: "https://idcs-123456.example.com",
},
logger: {
info: function (message) {
console.log(message);
}
}
});
import { contentSDK } from '@oracle/content-management-sdk';
// create a legacy preview client (using Management REST API)
// and output logging 'info' messages to the console
var previewClient = contentSDK.createPreviewClient({
contentServer: contentServer,
channelToken: channelToken,
authorization: 'Bearer A1234B5678C9012',
logger: {
info: function (message) {
console.log(message);
}
}
});