Skip to content

azum4roll/directus-sdk-javascript

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

directus-sdk-javascript

Directus SDK for JavaScript (Node and Browser)

Directus Logo

NPM

Installation

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

Usage

Require the RemoteInstance class (support for local instances coming soon)

const RemoteInstance = require('directus-sdk-javascript/remote');

const client = new RemoteInstance({
  url: 'http://instance.directus.io/api/1.1/',
  accessToken: [user-token] // optional, can be used without on public routes
});

The client returns a Promise which resolves the APIs JSON data on succes and rejects on error

client.getItems('projects')
  .then(res => console.log(res))
  .catch(err => console.log(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

Languages

  • JavaScript 100.0%