imagevault-client
TypeScript implementation of an ImageVault client.
Table of Contents
Installation
npm install imagevault-client
Usage
This package is meant to be used from TypeScript and transpiled to javascript for use in webbrowsers.
TypeScript
// Here we import everything from the module// under the ImageVault namespace.; // To authorize, we use authorization code grant.// Read more on grant types at imagevault.se/doc; // This client will be used for the actual API calls.; // Example using MediaService Find with a search string// and maximum result.; filter.searchString = "when dolphins left the planet";filter.take = 42; // Set up the query and call Find;;
Some callbacks are used for authorization flow and to allow re-use of Oauth tokens.
// With authorization code grant a URL needs to be opened// to handle the code part. This is called when the URL should// be opened.
// This is called when the Authorization code grant// has received a refresh token. The token can be saved// to re-use for new access token.
// If you have a valid refresh token stored// you can return it here and don't have// to go through the entire Oauth// authorization flow.
Node.js
Currently not supported. The package uses native XMLHttpRequest which is currently not handled Node.js.
Supported Grant types
The following grant types are supported:
- Authorization Code Grant
- Authorization Pin Code Grant
You can get more information on ImageVault grant types on the official ImageVault REST authentication documentation.
Supported services
The following services and methods are supported:
- CategoryService
- GetCategories
- InfoService
- Version
- MediaContentService
- PublishMedia
- MediaConversionService
- GetMediaContentReferences
- MediaService
- Find
- Assets
- Info
- Search
You can get more information on ImageVault services in the official ImageVault API service documentation and the new assets endpoint.
License and legal
This package is licensed under ISC, see included LICENSE
file or here. ImageVault is a registered trademark of Meriworks Holding AB.
Note: Although the creator is an employee at ImageVault, this is not an official Meriworks or ImageVault product.