npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@oracle/content-management-sdk

v1.6.2

Published

Oracle Content Management JavaScript SDK

Downloads

102

Readme

About Oracle Content Management - Content SDK (JavaScript)

The Content SDK for Oracle Content Management is a light-weight JavaScript wrapper that interacts with the Content REST APIs. This read-only SDK retrieves structured content, digital assets and content layouts that are managed in Oracle Content Management. The SDK allows you to write a web application that is content rich - allowing the use of Oracle Content Management for content management, authoring and approval and delivery from your own web server.

The SDK consists of three main classes:

  • contentSDK: The main entry-point object. The contentSDK object lets you create client objects to access content based on your requirements.
  • ContentDeliveryClient : A client object that is set up to access published content items and digital assets.
  • ContentPreviewClient : A client object that is set up to access content types, draft content items, and draft digital assets.

Installation

Prerequisite: node.js 10.9.0 or later, and node and npm on your path.

npm install @oracle/content-management-sdk

Documentation

Examples

NOTE: The SDK must be initialized with the URL of your content service. The URL uses the pattern https://<service-name>-<account-name>.cec.ocp.oraclecloud.com and can be given to you by your Oracle Content Management service administrator.

Using the SDK in NodeJS with ES6 import

// Imports the contentSDK class. You could import the createDeliveryClient or createPreviewClient functions instead.
import { contentSDK }  from '@oracle/content-management-sdk';

const contentDeliveryClient = contentSDK.createDeliveryClient({
  contentServer: 'https://<service-name>-<account-name>.cec.ocp.oraclecloud.com',
  contentVersion: 'v1.1',
  channelToken: '<token>', // Use your published channel token
  logger: console,
});

// Perform a load of an asset
contentDeliveryClient.getItem(....);

Using the SDK in NodeJS with require

// Imports the contentSDK class. You could import the createDeliveryClient or createPreviewClient functions instead.
const contentSDK = require('@oracle/content-management-sdk');

const contentDeliveryClient = contentSDK.createDeliveryClient({
  contentServer: 'https://<service-name>-<account-name>.cec.ocp.oraclecloud.com',
  contentVersion: 'v1.1',
  channelToken: '<token>', // Use your published channel token
  logger: console,
});

// Perform a load of an asset
contentDeliveryClient.getItem(....);

Using the SDK with import in an HTML page

<html>  
  <head>  
    <script type="module">
      import {createDeliveryClient} from 'path_to_expanded_contentsdk_package/content.umd.js';
      const client=createDeliveryClient({  
        contentServer: 'https://<service-name>-<account-name>.cec.ocp.oraclecloud.com',  
        contentVersion: 'v1.1',  
        channelToken: '<token>',
        logger: console,  
      });  
      client.getItem(....);
    </script>  
  </head>  
  <body>  
  </body>  
</html>  

Loading the SDK via a script tag

<html>
  <head>
      <title>Using Content SDK</title>
      <script src="url_of_expanded_contentsdk_package/content.umd.js"></script>
  </head>
  <body>
    <script>
      const client = contentsdk.createDeliveryClient({
        contentServer: 'https://<service-name>-<account-name>.cec.ocp.oraclecloud.com',
        contentVersion: 'v1.1',
        channelToken: '<token>',
        logger: console,
      });
      client.getItem(....);
    </script>
  </body>
</html>

Sample Projects

For more examples, check out our open source sample projects.

Contributing

This project welcomes contributions from the community. Before submitting a pull request, please review our contribution guide.

Security

Please consult the security guide for our responsible security vulnerability disclosure process.

License

Copyright (c) 2017, 2022, Oracle and/or its affiliates.

Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.