OpenModerator

No results

Help CenterGetting Started with OpenModeratorFirst Steps with the OpenModerator API and npm Package

First Steps with the OpenModerator API and npm Package

Last updated February 20, 2024

Introduction

Integrating OpenModerator into your platform is a straightforward process designed to bring powerful AI content moderation to your community with minimal effort. By using the OpenModerator API and npm package, you can start moderating text and images in no time. This guide will walk you through the initial steps to integrate OpenModerator using our API and npm package, setting the foundation for a safer online environment on your platform.

Steps to Integrate OpenModerator

  1. Install the OpenModerator npm Package
  • Begin by opening your terminal or command prompt. Navigate to your project directory and run the following command to install the OpenModerator npm package: Copy code npm install openmoderator
  • This command adds the OpenModerator package to your project, allowing you to utilize our moderation API directly from your application.
  1. Obtain Your API Key
  • Log in to your OpenModerator dashboard. Navigate to the API section and generate a new API key. This key will authenticate your requests to the OpenModerator API, ensuring secure communication between your application and our moderation services.
  1. Initialize OpenModerator in Your Project
  • In your project, import the OpenModerator package and initialize it with your API key. Here's a simple example in JavaScript: javascriptCopy code constOpenModerator = require('openmoderator'); const om = newOpenModerator({ apiKey: 'YOUR_API_KEY_HERE' });
  • Replace 'YOUR_API_KEY_HERE' with the API key you obtained from the dashboard.
  1. Make Your First Moderation Request
  • With OpenModerator initialized, you can now make a request to moderate content. Here's how to send a text string for moderation: javascriptCopy code om.moderateText('This is a sample text to moderate.') .then(response => { console.log('Moderation result:', response); }) .catch(error => { console.error('Moderation error:', error); });
  • This code sends a text string to OpenModerator and logs the moderation result. The response will include details on whether the content is appropriate or if it violates any moderation rules.
  1. Explore Further
  • After successfully making your first moderation request, explore the OpenModerator API documentation for more advanced features, including image moderation, custom rule creation, and real-time moderation analytics.

Conclusion

You've now taken the first steps towards integrating AI-powered content moderation into your platform with OpenModerator. By installing the npm package and making your first API request, you're on your way to creating a safer and more engaging online community. As you become more familiar with OpenModerator's capabilities, consider exploring advanced features to further enhance your moderation efforts. If you have any questions or need assistance, our support team is always here to help.

Was this article helpful?