Author Badges
Give your user a visual indicator of the article author in Conversation comment
Authors work diligently to write compelling articles. Due to his or her research on an article topic, an author has the insight to provide insightful responses to users' Conversation comments. When an author responds to a comment, the Author Badge gives your users a visual indicator that response came from the article author.
The Author Badge depends upon making backend-to-backend server calls.
Requirement
Implementation
Use the following steps to enable an author badge:
- Make a GET /sso/v1/user/primary_key call to retrieve the OpenWeb
userId
for the author of the article.
- In the launcher script, define the
data-author-id
attribute with theuserId
retrieved from the previous step.
When copying the following code examples, replace all the placeholders:SPOT_ID
,ARTICLE_URL
,ARTICLE_TOPIC1
,POST_ID
.
<script
async
src="https://launcher.spot.im/spot/SPOT_ID"
data-author-id="AUTHOR_ID" //as received from OpenWeb's get-user endpoint
data-spotim-module="spotim-launcher"
data-post-url="ARTICLE_URL"
data-article-tags="ARTICLE_TOPIC1, ARTICLE_TOPIC2"
data-post-id="POST_ID">
</script>
<div data-spotim-module="conversation" data-author-id="AUTHOR_ID" data-post-url="ARTICLE_URL" data-article-tags="ARTICLE_TOPIC1, ARTICLE_TOPIC2" data-post-id="POST_ID"></div>
Updated 3 months ago