FastComments.com

Add Comments With Memberstack


Dzięki FastComments możemy skonfigurować ekskluzywne komentarze dostępne wyłącznie dla członków, gdy są używane razem z Memberstackiem!


Kod Internal Link

Możemy łatwo połączyć FastComments z Memberstack za pomocą małego fragmentu kodu:

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

Gdy użytkownik odwiedzi Twoją stronę lub aplikację będąc zalogowanym przez Memberstack, zostanie automatycznie zalogowany do FastComments, a jego komentarze będą oznaczone jako Verified.

Będą również mogli komentować, zostawiając swoje imię i e-mail, jeśli nie są zalogowani.

Komentowanie tylko dla członków

Jeśli chcesz mieć komentowanie tylko dla członków, wypróbuj poniższy fragment kodu, ale zmień https://example.com/login na miejsce, gdzie chcesz, aby użytkownicy przechodzili po kliknięciu przycisku 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

Dostosowywanie Internal Link

FastComments jest zaprojektowany tak, aby można go było dostosować do Twojej strony.

Jeśli chcesz dodać niestandardowe style lub dostosować konfigurację, sprawdź naszą dokumentację dotyczącą dostosowywania, aby dowiedzieć się jak.