Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

usersnap-classic-component

chaider14ISCdeprecated1.0.3

This is not an official Usersnap package and therefore not supported. Use at your own risk.

An easy to use component to load the usersnap classic widget

readme

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