0.0.15 • Published 4 years ago

@contential/content v0.0.15

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

Contential - JavaScript SDK

JavaScript SDK for Contential content and GraphQL APIs. It helps you to easily access your data stored in Contential with your JavaScript applications.

Core features

  • Create, retrieve, update and remove records
  • Create, retrieve, update and remove lists
  • Subscribe to records and lists
  • Search lists
  • Make GraphQL queries on lists
  • Works in the browser and in Node.js

Requirements

Installation

npm install @contential/content

Contential client

Use the createClient method to create an authenticated client that connects to your data.

const { createClient } = require('@contential/content');
const contential = createClient({
  apiKey: 'e347fea300b50578870fda807ec455',
});

The Contential APIs use API keys to authenticate requests. You can view and manage your API keys in the Contential Dashboard.

Creating your first record

PropertyTypeExampleRequiredDescription
regionIdStringustrueRegion of where the data will be stored.
spaceIdString4dcb2eaf1dtrueID of space of where the data will be stored.
recordIdStringmy-recordtrueThe ID for your record.
localeIdStringen-USfalseLocale for your data to allow for translations.
dataString | ObjectMy record datatrueThe data for the record. Can be a string or an object.
const { createClient } = require('@contential/content');
const contential = createClient({
  apiKey: 'e347fea300b50578870fda807ec455',
});

contential.record
  .add({
    regionId: 'us',
    spaceId: '4dcb2eaf1d',
    recordId: 'my-record',
    localeId: 'en-US',
    data: { 'message":"Contential is amazing!' },
  })
  .then(result => console.log(result))
  .catch(error => console.log(error));

Documentation

For more details on getting started with Contential, visit the Contential Docs

Get involved

We appreciate any help you can give to improve Contential.

PRs are welcome!

Licencse

This repository is published under the MIT license.

0.0.13

4 years ago

0.0.14

4 years ago

0.0.15

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago