Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
fb-stm-button
Advanced tools
React JS component to render Facebook's Send-to-Messenger plugin (STM) FB Docs
Install:
npm i fb-stm-button
Import:
import FbStmButton from "fb-stm-button";
In your React JS project:
<FbStmButton appId="YOUR-APP-ID" pageId="YOUR-PAGE-ID" />
See official docs to learn more about each
pageId: PropTypes.string.isRequired,
appId: PropTypes.string.isRequired,
dataRef: PropTypes.string,
color: PropTypes.string,
size: PropTypes.string,
enforceLogin: PropTypes.bool,
ctaText: PropTypes.oneOf([
"GET_THIS_IN_MESSENGER",
"RECEIVE_THIS_IN_MESSENGER",
"SEND_THIS_TO_ME",
"GET_CUSTOMER_ASSISTANCE",
"GET_CUSTOMER_SERVICE",
"GET_SUPPORT",
"LET_US_CHAT",
"SEND_ME_MESSAGES",
"ALERT_ME_IN_MESSENGER",
"SEND_ME_UPDATES",
"MESSAGE_ME",
"LET_ME_KNOW",
"KEEP_ME_UPDATED",
"TELL_ME_MORE",
"SUBSCRIBE_IN_MESSENGER",
"SUBSCRIBE_TO_UPDATES",
"GET_MESSAGES",
"SUBSCRIBE",
"GET_STARTED_IN_MESSENGER",
"LEARN_MORE_IN_MESSENGER",
"GET_STARTED",
"SEND_TO_MESSENGER"
]),
autoLogAppEvents: PropTypes.bool,
xfbml: PropTypes.bool,
version: PropTypes.string,
language: PropTypes.string,
debug: PropTypes.bool,
subscribeEvents: PropTypes.func
import PropTypes from "prop-types";
import React from "react";
import FbStmButton from "fb-stm-button";
export default class StmBox extends React.Component {
constructor() {
super();
this.state = { stmLoaded: false };
}
events = e => {
console.log(e);
if (e.event === "rendered") this.setState({ stmLoaded: true });
};
render() {
return (
<div
className={`flex stm-button ${!this.state.stmLoaded && "loading"}`}
style={this.props.currentView === "email" ? { display: "none" } : {}}
>
<FbStmButton
appId="YOUR-APP-ID"
pageId="YOUR-PAGE-ID"
subscribeEvents={this.events}
/>
</div>
);
}
}
FAQs
Facebook Send To Messenger Button for React JS
The npm package fb-stm-button receives a total of 0 weekly downloads. As such, fb-stm-button popularity was classified as not popular.
We found that fb-stm-button demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.