@wral/sdk-curator
v1.0.0
Published
A Software Development Kit for working with curated searches
Downloads
19
Keywords
Readme
sdk-curator
The sdk-curator
is a JavaScript SDK (Software Development Kit) designed to interact with
the curator API.
Installation
You can install the `sdk-curator
npm install @wral/sdk-curator
Usage
To use the sdk-curator
, you first need to import it into your JavaScript or TypeScript project:
import { createClient } from '@wral/sdk-curator';
Then, you can create a client instance with your configuration:
const config = {
baseUrl: 'YOUR_BASE_URL', // Base URL of your API
apiKey: 'YOUR_API_KEY', // Your API key
};
const client = createClient(config);
After creating the client instance, you can use its methods to interact with the API.
API
createClient(config)
Creates a new client instance with the provided configuration.
config
: An object containing API configuration parameters:baseUrl
: The base URL of the API.
Returns a client instance with methods for interacting with the API.
Methods
api: (path, options = {})
: fetch wrapper for the API.getCollection: (id)
updateCollection: (id, collection)
patchCollection: (id, collection)
deleteCollection: (id)
searchCollections: (query)