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

datocms-client

Package Overview
Dependencies
Maintainers
1
Versions
225
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datocms-client

DatoCMS API client

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
increased by7.29%
Maintainers
1
Weekly downloads
 
Created
Source

DatoCMS JS Client

Build Status

Browser

<body>
  <script src="https://npmcdn.com/datocms-client/dist/datocms-client.min.js"></script>
  <script>
    var dato;

    DatoCmsClient.readOnlySession({
      domain: 'funky-sea-4874.admin.datocms.com',
      token: 'XXXYYY',
    })
    .then(function(session) {
      dato = new DatoCmsClient.ItemsRepo(session);
      return dato.refresh();
    })
    .then(function() {
      console.log(dato.find('9288').id);
      console.log(dato.find('9288').title);
      console.log(dato.find('9288').image.url({ w: 50 }));
    })
    .catch(function(e) {
      console.log(e);
    });
  </script>
</body>

Node.js

npm install --save datocms-client
import { readOnlySession, ItemsRepo } from 'datocms-client';

let dato;

readOnlySession({
  domain: 'funky-sea-4874.admin.datocms.com',
  token: 'XXXYYY',
})
.then(function(session) {
  dato = new ItemsRepo(session);
  return dato.refresh();
})
.then(function() {
  console.log(dato.find('9288').id);
  console.log(dato.find('9288').title);
  console.log(dato.find('9288').image.url({ w: 50 }));
})
.catch(function(e) {
  console.log(e);
});

Keywords

FAQs

Package last updated on 05 Jul 2016

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