1.0.3 • Published 6 years ago
usersnap-classic-component v1.0.3
Usersnap Classic Component
Installation
npm install --save usersnap-classic-component
How To Use
First import this component where you want to use it
import UsersnapClassicLoader from "usersnap-classic-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-classic-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-classic-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