2.0.2 • Published 4 years ago

@usecloudstate/react-core v2.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@usecloudstate/react-core

This is the core package for a React application on usecloudstate.io.

Installation

You can install the package with:

npm install @usecloudstate/react-core

Usage

Initiate CloudStateClient

We recommend you create a cloudState instance in a separate file and import it in your application.

// src/cloudState.js
import { CloudStateClient } from '@usecloudstate/react-core';

export const cloudState = new CloudStateClient("<YOUR APP ID>", {
  onAuthSuccess: () => {
    // for example, redirect to a dashboard
    history.location.replace('/dashboard');
  },
  onAuthRequest: () => {
    // for example, redirect to a login page
    history.location.replace('/login');
  },
});

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

2.0.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago