Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cms-module-client

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cms-module-client

An editor for html pages. This is the client side part of the JS CMS module tool. It lets you edit a webpage in a WYSIWYG way. Together with the Server side module, it creates nicely integrated content management system for Node JS.

  • 0.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

CMS Module Client

An editor for html pages. This is the client side part of the JS CMS module tool. It lets you edit a webpage in a WYSIWYG way. Together with the server side module, it creates nicely integrated content management system for Node JS.

Installation

To install this package, simply run:

npm install cms-module-client

Usage

Once installed, you need import it into your project and create an instance of the CMS class. Then, you simply have to call the cms.run() method. This will assign editable tags and render a toolbar containing editing options.

import CMS from "cms-module-client";

const cms = new CMS();

cms.run();

As you probably noticed, the package uses import syntax, which means that you need a javascript bundler of some sort. Webpack is recommended, but other bundlers are also available.

Security

As you would expect, when using a CMS system, security is a very important component. It should not be possibly for ordinary users to access the CMS editor or successfully make a request to the CMS endpoints. It is therefore strongly recommended that you have some kind of login system for administrators when using this module. The authnetication of users is not handled what so ever in the module, this responsibility is completely on you, as the developer of the service or website, to implement.

On the client, a simple way of athentication would be to specify the auth option in the CMS class to be the current session id.

Like so:

import CMS from "cms-module-client";
import { readCookie } from "./util";

const sessId = readCookie("SESSION_ID");
const cms = new CMS({ auth: sessId });

cms.run();

The value specified in the auth option will be sent as an Authorization header. This can then be used on the server to check the authorization status of the user sending the save request.

Keywords

FAQs

Package last updated on 04 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc