9.5.13 • Published 2 years ago

@contentchef/contentchef-management-js-client v9.5.13

Weekly downloads
3
License
UNLICENSED
Repository
github
Last release
2 years ago

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

2 years ago

9.5.11

2 years ago

9.5.12

2 years ago

9.5.10

2 years ago

9.5.9

2 years ago

9.5.8

2 years ago

9.5.5

4 years ago

9.5.7

3 years ago

9.5.6

4 years ago

9.6.0-alpha.0

3 years ago

9.5.4

4 years ago

9.5.3

4 years ago

9.5.2

4 years ago

9.5.1

4 years ago

9.5.0

4 years ago

9.4.0

4 years ago

9.3.3

4 years ago

9.3.2

4 years ago

9.3.1

4 years ago

9.3.0

4 years ago

9.2.0

4 years ago

9.1.0

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

8.0.3

4 years ago

8.0.1

5 years ago

8.0.0

5 years ago

8.0.2

5 years ago

7.18.1

5 years ago

7.18.0

5 years ago

7.17.0

5 years ago

7.16.0

5 years ago

7.15.0

5 years ago

7.14.0

5 years ago

7.13.1

5 years ago

7.13.0

5 years ago