directus-sdk-javascript
WIP - Directus SDK for JavaScript (Node and Browser)
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/',
1.1
);
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