Skip to content

sendbird/content-moderation-javascript-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Content Moderation Javascript Sample

Platform Languages npm

Table of contents

  1. Introduction
  2. Before getting started
  3. Getting started

Introduction

The content moderation sample utilizes the Sendbird Platform SDK to ban a user from a group channel if the message sent is considered to be toxic. The Perspective API analyzes message and returns a decimal score between 0 and 1 ranking how toxic the message is. A webhook is used Express and Ngrok to connect to the Sendbird server and receieve a request each time a message is sent in an applications group channel.


Before getting started

This section shows you the prerequisites you need to set up the Content Moderation Sample for Javascript. If you have any comments or questions regarding bugs and feature requests, visit Sendbird community.

Requirements

The minimum requirements for Calls SDK for Javascript sample are:

  • Node
  • npm (or yarn)
  • Modern browser, supporting WebRTC APIs.

Getting started

This section gives you information you need to get started with the Content Moderation Sample.

Installations

  1. Use NodeJS for your local server: Download and install NodeJS if your system doesn't have it yet.

  2. Install ExpressJS, GoogleApis, Ngrok, and Perspective Api Client.

  3. Install the Sendbird Platform SDK for local development.

Create a Sendbird application

  1. Login or Sign-up for an account on Sendbird Dashboard.
  2. Create or select an application on the dashboard.
  3. Note your Sendbird application ID for future reference.

Enable Webhooks

  1. On the Sendbird dashboard, navigate to the Settings menu. Under Chat, go to Features to enable Webhooks.
  2. Go to Settings, under Chat click Webhooks. In Events, select the event that you want to subscribe to. For this sample, click Group Channel and select 'group_channel:message_send' to subscribe to the event where a user sends a message.
  3. In Settings under Chat in Webhooks, ensure that the webhook URL is set once Ngrok is installed and running. The Ngrok URL that is generated along with the post method path used in the application will be the webhook URL you want to use to recieve webhook events from the Sendbird server.

Create test users

  1. On the Sendbird dashboard, navigate to the Users menu.
  2. Create a new user

Create Group Channel

  1. On the Sendbird dashboard, navigate to the Group Channels menu.
  2. Create a new group channel

Now that there is a user and a group channel, send a message through the dashboard to test the sample as walk through it.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors