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

@pyvot360/cms

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pyvot360/cms

Client SDK for CMS360

  • 1.0.1
  • Source
  • npm
  • Socket score

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

CMS360 SDK Documentation (JS)

Report a bug/issue 🪲

Prerequisite: Your API Key (16 digits alphanumeric). Head over to our website to create yours for free!

Installation

  • Unpkg

    <script src="https://unpkg.com/@pyvot360/cms" type="module" ></script>
    
  • NPM

    npm i @pyvot360/cms
    
  • YARN

    yarn add @pyvot360/cms
    

Import

```
const {ClientSDK} = require("@pyvot360/cms");
// import {ClientSDK} from "@pyvot360/cms";

const sdk = new ClientSDK('YOUR-API-KEY');
```

Methods

  • sdk.getAll() (async) Fetches all articles
  • sdk.getById(articleId: string) (async) Fetches one article by id
  • sdk.getByUrl(articleUrl: string) (async) Fetches one article by url string
  • sdk.getTopics() (async) Fetches all topics
  • sdk.search(filters: ArticleFilters) * (async) Fetches articles related to search filters
  • sdk.viewed(articleId: string) (async) Updates the view count of an article
Note: All methods are async (return a promise). You may choose to handle that using await or .then()

Types & Interfaces

export declare interface Article {
    id?: string;
    title: string;
    author: Partial<Author>;
    banner: string;
    content: string;
    tags: string[];
    stats?: ArticleStats;
    dateWritten?: number;
    dateEditted?: number;
    isPublished: boolean;
    _secondaryKey?: string;
    url?: string;
}

export declare interface ArticleStats {
    views: number;
}

export declare interface Author {
    name?: string;
    bio?: string;
    email?: string;
    avatar?: string;
}

export declare interface ArticleFilters {
    title?: string;
    tag?: string;
    author?: string;
}

export declare class ClientSDK {
    constructor(key: string);
    getAll():  Promise<Article[]>;
    getById(articleId: string): Promise<Article | undefined>;
    getByUrl(articleUrl: string): Promise<Article | undefined>;
    getTopics(): Promise<string[]>;
    search(filters: ArticleFilters): Promise<Article[]>;
    viewed(articleId: string);
}

Keywords

FAQs

Package last updated on 19 Dec 2022

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