Files
directus/packages/sdk
Jay Cammarano a7b0cbe69b GitHub workflow to run tests on pushes to main and PRs (#8247)
* testing workflow

* name changed

* generateHash working

* changed pendingMock() to 0 because ticks > 5000

* removed empty tests

* removed empty tests

* Update packages/sdk/tests/utils.ts

Co-authored-by: José Varela <joselcvarela@gmail.com>

* updated workflow to add build

* added npm run build

* fixed get-filter-operators

* added env to workflow

* potential fix to index.test.ts

* added env variables for index.test.ts

* added caching and node-version matrix

* added all supported node versions

* only supported node versions

* updated to only support 16

* removed duplicate workflow caching

Co-authored-by: José Varela <joselcvarela@gmail.com>
2021-09-27 15:10:29 -04:00
..
2021-03-30 18:23:23 -04:00
2021-03-30 18:23:23 -04:00
2021-03-30 18:23:23 -04:00
2021-03-30 18:23:23 -04:00
2021-03-30 18:23:23 -04:00
2021-03-30 18:23:23 -04:00

Directus JS SDK

Installation

npm install @directus/sdk

Usage

import { Directus } from '@directus/sdk';

const directus = new Directus('https://api.example.com/');

const items = await directus.items('articles').readOne(15);
console.log(items);
import { Directus } from '@directus/sdk';

const directus = new Directus('https://api.example.com/');

directus
	.items('articles')
	.readOne(15)
	.then((item) => {
		console.log(item);
	});

Docs

See the docs