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 🙏

© 2026 – Pkg Stats / Ryan Hefner

webcenterjs

v1.0.13

Published

A Framework Independent Javascript Library that makes working with Oracle WebCenter REST API a breeze.

Readme

WebCenterJS

A Framework independent javascript library that makes working with Oracle WebCenter (11g & 12c) REST API a breeze.It cannot get any simpler than this

Library encapsulates all the logic necessary for

Works with framework of your choice. KnockoutJS, Angular, React, React Native, NodeJS, jQuery just to name a few.

Features

  • Built with TypeScript.
  • Distributed as NPM & Bower packages.
  • CommonJS & Bundled distributions.
  • Full Intellisense in Visual Code, WebStorm , Sublime Text etc.
  • Type Definitions.
  • Automatically handles utoken & Link Model parsing.
  • Promise based.

Installation

NPM

CommonJS distribution that integrates well with Modern frameworks like Angular, React, Aurelia, VueJS, etc.

> npm install webcenterjs --save

Bower

Bundled distribution that integrates well with jQuery, KnockoutJS or plain old javascript.

> bower install webcenterjs --save

Usage

TypeScript / ES6

Install webcenterjs NPM module as shown above and use the following snippet.

// import module
import WebCenter from "webcenterjs";
import {WallMessageItem} from "webcenterjs"; // Required only for TypeScript, for type definitions.

/**
* Assuming Oracle WebCeter Installation is available at 
* http(s)://wc-host-name:8888/. The following context roots will be available
* OOTB
* 
* WebCenter : http(s)://wc-host-name:8888/webcenter
* Content : http(s)://wc-host-name:16200/cs
* REST API : http(s)://wc-host-name:8888/rest
*/

/**
* Set REST Base URL. 
* Automatically defaults to [window.location.protocol, "//", window.location.host, "/rest"].join("") when running on browser. 
* 
* Defaults to "/rest" when running on NodeJS, React Native.
* 
* It is recommended to set the REST Base URL
*/
WebCenter.Config.setRestBaseUrl("http(s)://wc-host-name:8888/rest");

/**OPTIONAL : Optionally set WC & CS Base URLs as shown below
* The WC & CS URLs will come into play only for Basic Authentication and not for SSO or OIT.
*/
WebCenter.Config.setWcBaseUrl("http(s)://wc-host-name:8888/webcenter");
WebCenter.Config.setCsBaseUrl("http(s)://wc-host-name:16200/cs");

/**OPTIONAL : Optionally set Usename & Password
* 1. When username & password are provided, Basic Authentication is used.
* 2. WebCenter.Auth.setOIT("<OIT_TOKEN>") can be used to work with OIT token. 
* 3. When neither is provided, SSO is assumed.
*/
WebCenter.Auth.setUserName(username);
WebCenter.Auth.setPassword(password);


WebCenter.Wall.postMessage("Awesome Message from WebcenterJS !!!!").then((messageItem: WallMessageItem) => {
	console.log("------ Congrats on your Post ---------", messageItem.id);
}, (error: any) => {
	console.error(error);
});

In the above example, when postMessage is done, the following happens

  1. GET request to http(s)://wc-host-name:8888/rest/resourceIndex with Basic Auth.
  2. Extract uToken.
  3. Parse Link Model.
  4. postMessage using the uToken

Explicit login can be performed using the following snippet, if needed

WebCenter.Auth.login().then((resourceIndex: ResourceIndex) => {
	console.log(resourceIndex);
	// ... Do something elese
	// for ex.
	
	/**
	WebCenter.Wall.postMessage("Awesome Message from WebcenterJS !!!!").then((messageItem: WallMessageItem) => {
		console.log("------ Congrats on your Post ---------", messageItem.id);
	}, (error: any) => {
		console.error(error);
	});
	*/

},(error:Error) => {
	console.error(error);
});

ES5 (Plain Old JavaScript in Browser)

<script src="bower_components/webcenterjs/dist/webcenter.min.js"></script>

With the above script a global object WebCenter is registered on the window.

/**
* Assuming Oracle WebCeter Installation is available at 
* http(s)://wc-host-name:8888/. The following context roots will be available
* OOTB
* 
* WebCenter : http(s)://wc-host-name:8888/webcenter
* Content : http(s)://wc-host-name:16200/cs
* REST API : http(s)://wc-host-name:8888/rest
*/

/**
* Set REST Base URL. 
* Automatically defaults to [window.location.protocol, "//", window.location.host, "/rest"].join("") when running on browser. 
* 
* Defaults to "/rest" when running on NodeJS, React Native.
* 
* It is recommended to set the REST Base URL
*/
WebCenter.Config.setRestBaseUrl("http(s)://wc-host-name:8888/rest");

/**OPTIONAL : Optionally set WC & CS Base URLs as shown below
* The WC & CS URLs will come into play only for Basic Authentication and not for SSO or OIT.
*/
WebCenter.Config.setWcBaseUrl("http(s)://wc-host-name:8888/webcenter");
WebCenter.Config.setCsBaseUrl("http(s)://wc-host-name:16200/cs");

/**OPTIONAL : Optionally set Usename & Password
* 1. When username & password are provided, Basic Authentication is used.
* 2. WebCenter.Auth.setOIT("<OIT_TOKEN>") can be used to work with OIT token. 
* 3. When neither is provided, SSO is assumed.
*/
WebCenter.Auth.setUserName(username);
WebCenter.Auth.setPassword(password);

WebCenter.Wall.postMessage("Awesome Message from WebcenterJS !!!!").then(function(messageItem){
	console.log("------ Congrats on your Post ---------", messageItem.id);
}, function(error){
	console.error(error);
});

Explicit login can be performed using the following snippet, if needed

WebCenter.Auth.login().then(function(resourceIndex){
	console.log(resourceIndex);
	// ... Do something elese
	// for ex.
	
	/**
	WebCenter.Wall.postMessage("Awesome Message from WebcenterJS !!!!").then(function(messageItem){
		console.log("------ Congrats on your Post ---------", messageItem.id);
	}, function(error) => {
		console.error(error);
	});
	*/

},function(error){
	console.error(error);
});

Prerequisites

Make sure Oracle WebCenter Portal is configured as per instructions at Configuring REST APIs

Link Model (HATEOAS)

Oracle WebCenter REST API responses confirm to HATEOAS Standard.

WebCenterJS automatically parses the link model and enriches the response as shown below Chrome Console

In the above screenshot, note that the response wcResIdx is enriched and contains several methods that can be called direclty (getInvitations in this case).