Socket
Socket
Sign inDemoInstall

cms-module-client

Package Overview
Dependencies
1
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

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.


Version published
Weekly downloads
14
Maintainers
1
Install size
88.3 kB
Created
Weekly downloads
 

Readme

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

Last updated on 08 Nov 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc