Skip to content

Alxmerino/directus-sdk-javascript

Repository files navigation

directus-sdk-javascript

WIP - Directus SDK for JavaScript (Node and Browser)

Directus Logo

NPM

Installation and Usage

Install the package via npm npm install directus-sdk-javascript

Initialize the SDK object with your the desired api key and url

const SDK = require('directus-sdk-javascript');

const client = new SDK(
  'api-key-12345',
  'http://directus.url/api/', // Directus-hosted or own server
  1.1 // API Version
);

All methods can be used with either callbacks or promises.

client.getEntries('projects', (err, res) => {
  if(err) throw err;
  console.log(res);
});
client.getEntries('projects')
  .then(res => {
    console.log(res);
  })
  .catch(err => {
    throw err;
  });

Check the official API docs for a complete overview of all endpoints and available methods

About

WIP - Directus SDK for JavaScript (Node and Browser)

Resources

License

Stars

Watchers

Forks

Packages

No packages published