9.5.13 • Published 11 months ago
@contentchef/contentchef-management-js-client v9.5.13
ContentChef Management JS Client
Installing
Using npm:
$ npm install @contentchef/contentchef-management-js-client
Using yarn:
$ yarn add @contentchef/contentchef-management-js-client
Examples
- Configuration example This code will show how to correctly configure your ContentChef Management JS Client
class ContentChefApi {
api: ContentChefClient;
// The token is the authorizer that is needed to make actions in your space, for security problems the operation of setting the token
// should me make in a server side application
apiTokenResolver: AuthenticationTokenResolver = {
getToken: async () => {
return await 'do stuffs to retrieve your api token';
}
};
spaceIdResolver: SpaceIdResolver = {
getSpaceId: async () => {
return await 'do Stuff to retrieve your space id';
}
};
initializeClient = () => {
this.api = createChefSpaceClient(apiTokenResolver, spaceIdResolver, { apiRoot: 'https://api.contentchef.io' });
}
}
// We do this to create a singleton of the client
export const contentChefApi = new ContentChefApi().initializeClient();
- Usage example This code will show how to correctly use your ContentChef Management JS Client after the initial configuration
class ContentChefContentStore {
api: ContentChefClient;
constructor (chefApi: ContentChefClient) {
this.api = chefApi
}
async getContent (reqParams: GetContentRequest) {
try {
const response = await this.api.contents.get(reqParam);
console.log('This is the requested content');
console.log(response);
} catch (e) {
console.log(`An error occurred retrieving the content with id ${reqParams.id}`);
console.log(e);
}
}
}
Docs
To generate a new Documentation simply run the command
Using yarn:
$ yarn generate-docs
A new documentation will be created inside the folder docs in the root of the project, then simply serve the index.html file inside the docs folder in your browser
9.5.13
11 months ago
9.5.11
12 months ago
9.5.12
11 months ago
9.5.10
12 months ago
9.5.9
1 year ago
9.5.8
1 year ago
9.5.5
2 years ago
9.5.7
2 years ago
9.5.6
2 years ago
9.6.0-alpha.0
2 years ago
9.5.4
2 years ago
9.5.3
3 years ago
9.5.2
3 years ago
9.5.1
3 years ago
9.5.0
3 years ago
9.4.0
3 years ago
9.3.3
3 years ago
9.3.2
3 years ago
9.3.1
3 years ago
9.3.0
3 years ago
9.2.0
3 years ago
9.1.0
3 years ago
9.0.1
3 years ago
9.0.0
3 years ago
8.0.3
3 years ago
8.0.1
3 years ago
8.0.0
3 years ago
8.0.2
3 years ago
7.18.1
4 years ago
7.18.0
4 years ago
7.17.0
4 years ago
7.16.0
4 years ago
7.15.0
4 years ago
7.14.0
4 years ago
7.13.1
4 years ago
7.13.0
4 years ago