Skip to content

TobitSoftware/chayns-api

Repository files navigation

The chayns-api provides information and useful functions to your page. The information and functions are provided by react hooks and normal functions. A list of all functions and hooks can be found here.

Installation

It is recommended to setup your new chayns page with the create-chayns-app.

Migrate old project

  1. Install chayns-api package
# NPM
$ npm install chayns-api

# Yarn
$ yarn add chayns-api
  1. Wrap your App component with the "ChaynsProvider" component. In all components which are under the ChaynsProvider you can use hooks and chayns functions.
<ChaynsProvider>
   <App/>
</ChaynsProvider>

Example

import { useUser } from 'chayns-api';

const FirstName = () => {
    const user = useUser();

    return (
        <div>{user?.firstName}</div>
    );
}

Migration

For migration guides between major versions, please refer to the migration documentation.

Getting started

More information to setup chayns-api can be found in the documentation.

For advanced use cases like Module Federation, refer to the Module Federation Guide.

License

About

The chayns React API provides a variety of helpful features to enhance your site.

Topics

Resources

License

Stars

2 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors