
Idioma 🇪🇸 Español
Primeros pasos
Documentación
Uso
FastComments React Native Library
Esta es la biblioteca oficial de React Native para FastComments.
Widgets de comentarios de FastComments para React Native
Repositorio
Instalación 
npm install react-native-webview@13.6.4 --save
npm install fastcomments-react-native --save
Nota: A partir de julio de 2024 parece que react-native-webview tiene un error, por lo que es mejor fijar la versión a 13.6.4 - no use ^ para obtener la última versión de parche.
Considere el SDK nativo 
Esta biblioteca utiliza un webview alrededor de la biblioteca VanillaJS.
FastComments ahora admite una implementación completamente nativa de nuestro cliente como parte de fastcomments-react-native-sdk. Si quieres una implementación completamente nativa, quizá quieras echarle un vistazo allí.
Uso - Widget de comentarios en vivo 
La API es ligeramente diferente en comparación con fastcomments-react. Con la versión nativa, pasamos un objeto config que sigue esta estructura.
import { FastCommentsCommentWidget } from 'fastcomments-react-native';
// ...
const myTenantId = 'demo'; // Your tenant id. Can be fetched from https://fastcomments.com/auth/my-account/api-secret
const myAppPageId = 'native-test'; // the ID or URL of the comment thread in your app.
const myAppPageUrl = 'https://example.com/external-page'; // you can optional set a url to an external page
const myAppPageTitle = 'Example Title'; // ... and you probably want a title for this content
const [config, setConfig] = useState({
tenantId: myTenantId,
urlId: myAppPageId,
url: myAppPageUrl,
pageTitle: myAppPageTitle
});
// al llamar a setConfig(), podemos hacer cosas como cambiar la página actual, o el usuario actualmente conectado
// Consulta example/src/App.tsx
return (
<FastCommentsCommentWidget config={config}/>
);
Uso - Widget de chat en vivo 
import { FastCommentsLiveChatWidget } from 'fastcomments-react-native';
// ...
const myTenantId = 'demo'; // Tu tenant ID. Puede obtenerse desde https://fastcomments.com/auth/my-account/api-secret
const myAppPageId = 'native-test'; // El ID o URL del hilo de comentarios en tu app.
const myAppPageUrl = 'https://example.com/external-page'; // puedes configurar opcionalmente una URL a una página externa
const myAppPageTitle = 'Example Title'; // ... y probablemente querrás un título para este contenido
const config = {
tenantId: myTenantId,
urlId: myAppPageId,
url: myAppPageUrl,
pageTitle: myAppPageTitle
};
return (
<FastCommentsLiveChatWidget config={config}/>
);
Uso - SSO (Inicio de sesión único) 
FastComments utiliza HMAC para SSO seguro. Para usarlo, haga que su backend cree el objeto SSO (propiedad de configuración sso) y páselo
al widget de comentarios.
Puede encontrar ejemplos para varios backends aquí: https://github.com/FastComments/fastcomments-code-examples/tree/master/sso
Dependencias peer 
fastcomments-react-native requires react-native-webview. Por lo tanto, debe seguir los pasos de instalación de react-native-webview.
Región de la cuenta (ATENCIÓN: clientes de la UE)
Si su cuenta está ubicada en la UE, establezca region = 'eu' en la configuración del widget.
De lo contrario, no es necesario definir region.
¿Necesita ayuda?
Si encuentra algún problema o tiene preguntas sobre la biblioteca de React Native, por favor:
Contribuciones
¡Las contribuciones son bienvenidas! Por favor visite el repositorio de GitHub para conocer las directrices de contribución.