Socket
Book a DemoInstallSign in
Socket

@skedify/plugin-react

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@skedify/plugin-react

React wrapper component for the Skedify Plugin

latest
Source
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

@skedify/plugin-react

Wrapper around the Skedify Plugin, to integrate it more conveniently inside React Applications.

There are 2 exports:

  • <SkedifyPlugin configuration={configuration} />: React Component that renders the plugin inside a div. You can pass plugin options to it using the configuration prop. All other props are passed through to the underlying div element.

  • <SkedifyPluginProvider value={configuration}>: This is a React Context Provider, that allows you to set certain default values. The interface is the same as the configuration prop.

    This component is not required, but can be useful to populate some shared configuration for each plugin instance, eg:

const defaultConfig = {
  scriptSrc: "https://plugin.skedify.io/{ENTERPRISE_NAME}/skedify-plugin.js",
  language: "nl-be",
  flow: "S'TQC",
  meeting_types: "video",
  timezone: "Europe/Brussels",
  oauth: {
    client: "XXX",
  },
  appointment: {
    office_id: "1",
  },
};

function App() {
  return (
    <SkedifyPluginProvider value={defaultConfig}>
      {/* All <SkedifyPlugin /> components will now merge their own passed configuration with the defaultConfig value */}
      <SkedifyPlugin configuration={{ appointment: { subject_id: "1" } }}>
    </SkedifyPluginProvider>
  );
}

The SkedifyPlugin reads the current context value, and merges it with its own passed props.

Required props:

  • scriptSrc: The plugin entry point URL. eg: https://plugin.skedify.io/{ENTERPRISE_NAME}/skedify-plugin.js

FAQs

Package last updated on 19 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts