Exciting news!Announcing our $4.6M Series Seed. Learn more
Socket
LoveBlogFAQ
Install
Log in

@craftercms/classes

Package Overview
Dependencies
4
Maintainers
3
Versions
18
Issues
File Explorer

Advanced tools

@craftercms/classes

Crafter CMS utility classes for developing sites and applications

    2.0.6latest

Version published
Maintainers
3
Yearly downloads
11,204
increased by110.36%

Weekly downloads

Readme

Source

npm (scoped)

@craftercms/classes

This package contains useful classes for developing craftercms websites & applications.

Usage

All of Crafter CMS packages can be used either via npm or in plain html/javascript via regular script imports.

  • Install module using yarn or npm
    • yarn add @craftercms/classes or
    • npm install @craftercms/classes
  • Import and use the classes you need

Package Index

The examples below assume usage in the style of using via npm. If you're using the bundles, directly importing as a script in the browser, these functions will be under the global variable named craftercms.classes (i.e. window.craftercms.classes).

crafterConf

Example

The crafterConf is a special class to globally configure CrafterCMS libraries. Most services you can supply these configurations on a call-by-call basis, but you may simplify by configuring all services via crafterConf early-on on your application bootstrap.

import { crafterConf } from '@craftercms/classes'; crafterConf.configure({ baseUrl: process.env.CRAFTER_HOST_NAME, site: process.env.CRAFTER_SITE_NAME, cors: true, headers: { headerForAllRequests: 'some-value' } });

SDK Service

SDKService Provides http get and post methods for Crafter services

Examples

import { httpGet } from '@craftercms/classes'; const requestURL = "/some-url"; httpGet(requestURL, { crafterSite: "editorial" }).subscribe((response) => { console.log(response); })

Keywords

Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc