1.0.0 • Published 5 years ago
usersnap-react-component v1.0.0
React Color Component
Installation
npm install --save usersnap-react-component
How To Use
First import this component where you want to use it
import UsersnapClassicLoader from "usersnap-react-component"
Then just use it in your render method like this
<UsersnapClassicLoader apikey="YOUR-APIKEY" />
Props
Prop | Description | Default value |
---|---|---|
apiKey | API Key of your classic project | "" |
config | Custom configuration for the widget | {} |
exposeAPI | When true, the API will be exposed to window.Usersnap | false |
Please note that a valid apikey is required to load the Usersnap Classic Widget correctly. The apikey can be found in the settings of your Usersnap Classic Project.
Examples
import React, { Component } from "react";
import UsersnapClassicLoader from "usersnap-react-component";
class App extends Component {
render() {
return (
<UsersnapClassicLoader apiKey="YOUR-APIKEY" />
);
}
}
export default App;
Exposing the API
import React, { Component } from "react";
import UsersnapClassicLoader from "usersnap-react-component";
class App extends Component {
render() {
return (
<UsersnapClassicLoader apiKey="YOUR-APIKEY" exposeAPI={true}/>
);
}
}
export default App;
Now you can control the widget via the API and open it like so: window.Usersnap.open()
For more information on how to use the API please have a look here: https://help.usersnap.com/docs/api-for-usersnap-classic-new
1.0.0
5 years ago