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

@content-app/core

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@content-app/core

content-app/core

  • 0.1.4
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

content-app/core

Logo

Build your website with contentful.


Install

npm i @content-app/core

Model

Content model

API

createCoreModels(client: ClientAPI, options: Options)

This function creates the content types in your space.

import contentful from 'contentful-management';

(async () => { 
const client = contentful.createClient({
    accessToken: 'YOUR_ACCESS_TOKEN',
})

await createCoreModels(client, {
    spaceId: 'YOUR_SPACE_ID',
    environment: 'YOUR_ENVIRONMENT',
});
})();

Modules

There are several ways to hook into the system. For example, you might want to implement a module that installs one or more content types, or you may want to add more pages, or you may want to add more data. Even though there will be a page for every page contentype, there could be cases when you want to add your own.

Modules - Add you own content types

If you want to use this feature you need to install the cli https://github.com/content-app/cli.

  • First you need to install the module via npm. For example: npm install module-content-stage
  • Then you can use the command content-app load-content-module <contentModule>.
  • This command will look after this file in the current path: node_modules/@content-app/content-module_${contentModule}/install.js
  • The command will then import the exported function and call it with following arguments: client, space, environment

So your install.js might start like this.

module.exports = async function({ client, space, environment }) {
     const myEntry = await environment.createContentTypeWithId({... your configs}, 'MyContentypeId');
     await myEntry.publish();
};

FAQs

Package last updated on 10 Apr 2023

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