FastComments.com

Add Comments With Memberstack


Con FastComments, podemos configurar comentarios exclusivos solo para miembros cuando se combine con Memberstack!


El código Internal Link

Podemos conectar fácilmente FastComments con Memberstack con un pequeño fragmento de código:

FastComments Memberstack Snippet
Copy Copy
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<div id="fastcomments-widget"></div>
4<script>
5 window.$memberstackDom.getCurrentMember().then(({data: member}) => {
6 if (member) {
7 FastCommentsUI(document.getElementById('fastcomments-widget'), {
8 tenantId: "demo",
9 urlId: window.location.pathname,
10 simpleSSO: {
11 username: member.customFields.name || member.auth.email.replace(/@.+/, ''),
12 email: member.auth.email,
13 avatar: member.customFields.avatar
14 }
15 });
16 } else {
17 FastCommentsUI(document.getElementById('fastcomments-widget'), {
18 tenantId: "demo",
19 urlId: window.location.pathname,
20 simpleSSO: null
21 });
22 }
23 })
24</script>
25

Cuando el usuario visita su sitio o aplicación mientras está conectado a través de Memberstack, iniciará sesión automáticamente en FastComments y sus comentarios se marcarán como Verified.

También podrán comentar dejando su nombre y correo electrónico, si no han iniciado sesión.

Comentarios solo para miembros

Si desea tener comentarios solo para miembros, pruebe el siguiente fragmento de código, pero cambie https://example.com/login al lugar donde desea que los usuarios vayan cuando hagan clic en el botón Login:

Exclusive FastComments Memberstack Snippet
Copy Copy
1
2<script src="https://cdn.fastcomments.com/js/embed-v2.min.js"></script>
3<div id="fastcomments-widget"></div>
4<script>
5 window.$memberstackDom.getCurrentMember().then(({data: member}) => {
6 if (member) {
7 FastCommentsUI(document.getElementById('fastcomments-widget'), {
8 tenantId: "demo",
9 urlId: window.location.pathname,
10 simpleSSO: {
11 username: member.customFields.name || member.auth.email.replace(/@.+/, ''),
12 email: member.auth.email,
13 avatar: member.customFields.avatar
14 }
15 });
16 } else {
17 FastCommentsUI(document.getElementById('fastcomments-widget'), {
18 tenantId: "demo",
19 urlId: window.location.pathname,
20 simpleSSO: {
21 loginURL: 'https://example.com/login'
22 }
23 });
24 }
25 })
26</script>
27

Personalización Internal Link

FastComments está diseñado para ser personalizado y coincidir con su sitio.

Si desea agregar estilos personalizados o ajustar la configuración, consulte nuestra documentación de personalización para aprender cómo.