evo-client-lib
v0.0.9
Published
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Readme
EVO SDK
- simplifies tasks such as authentication and authorization
Server Requirements
- A server somewhere running Evo Server
[email protected]:evolvco/evo-server.git
Quick starts
- There are two Quick start repos
- Javascript Client
- Typescript Client
- the quick starts are configured to use
evo-client-libbut do not install it so you have to follow the Install section after you clone one of the quickstart projects
integration into an existing client
Client Requirements
- If your are not using a quik start package
- Either a proxy directing all traffic from your client going to
/apiand/wsto the Evo Server, or setting the domain of the lib usingsetRestDomain, andsetSocketDomain - Proxy example using vite proxy
- Set Domains example
install
- clone the lib in the parent folder of your project. from your project root (or quickstart root) run
cd ../
git clone [email protected]:evolvco/evo-client-lib.git- link this package to your project root (or quickstart root) by running the following from your project root.
npm init -w ../evo-client-lib
- run from your project root.
npm i evo-client-lib
Authentication
- the quickstarts already integrate Authentication
- follow one of these tutorials if you are integration into an existing project
- helpers include an AuthProvider and a useAuth hook
- React Router Example
- Simple Example without React Router
Meta Models
- meta models are json objects that describe the structure of a model.
- They descibe things like field names and types, validators, join relationships, hooks, exe.
- Eample using out of the box react hooks
- Example using a custom hook included in the library
Model Records
Web Sockets
- every meta model can be optionally backed by a web socket
- Setup
- Model Binding Example
Components
RequireAuth
| Parameter | Type | Example | Options | | --------- | ----------- | -------- | ------- | | children | React.Children | | | | onFailure | function | (e)=>{} | | | loader | React.Node | | | | loaderClass | String | | |
LoginForm
| Parameter | Type | Example | Options | | --------- | ----------- | -------- | ------- | | onSuccess | function | ()=>{} | | | onFailure | function | (e)=>{} | | | formClass | String | | | | errorClass | String | | | | labelClass | String | | | | inputClass | String | | | | headerClass | String | | | | footerClass | String | | | | submitClass | String | | |
