Quick Start
This guide will show you how to get started through code samples. It will cover:
-
How to use the Respectify client class in your language to interact with Respectify
-
Initialise Respectify with a topic: this gives Respectify an understanding of what people are commenting on, and is usually a blog post, article, etc
-
Evaluate a comment, and get Respectify's feedback on how well it contributes to the conversation and in what ways the reply can be improved in order to encourage healthy interaction.
Installation and Authentication
Install the library and get an API key. See Installation for full details.
- TypeScript
- Python
- PHP
npm install @respectify/client
pip install respectify
composer require respectify/respectify-php
Check User Credentials
Verifies your credentials work correctly. See Installation for more details.
- TypeScript
- Python
- PHP
- REST API
import { RespectifyClient } from "@respectify/client";
const client = new RespectifyClient({
email: "your-email@example.com",
apiKey: "your-api-key",
});
const result = await client.checkUserCredentials();
console.log(`Active: ${result.active}`);
console.log(`Plan: ${result.plan_name}`);
console.log(`Endpoints: ${result.allowed_endpoints}`);
- Blocking Client
- Async Client
from respectify import RespectifyClient
client = RespectifyClient(email, api_key)
result = client.check_user_credentials()
print(f"Active: {result.active}")
print(f"Plan: {result.plan_name}")
print(f"Endpoints: {result.allowed_endpoints}")
from respectify import RespectifyAsyncClient
client = RespectifyAsyncClient(email, api_key)
result = await client.check_user_credentials()
print(f"Active: {result.active}")
print(f"Plan: {result.plan_name}")
print(f"Endpoints: {result.allowed_endpoints}")
use Respectify\RespectifyClientAsync;
$client = new RespectifyClientAsync('your-email@example.com', 'your-api-key');
$client->checkUserCredentials()
->then(function ($result) {
echo "Active: " . ($result['active'] ? 'Yes' : 'No') . "\n";
echo "Plan: " . $result['plan_name'] . "\n";
});
$client->run();
curl -X GET https://app.respectify.ai/v0.2/usercheck \
-H "X-User-Email: your-email@example.com" \
-H "X-API-Key: your-api-key"
Response:
{
"active": true,
"status": "ACTIVE",
"plan_name": "Professional",
"allowed_endpoints": ["antispam", "commentscore", "relevance", "dogwhistle", "megacall"],
"expires": "2025-12-31T23:59:59Z"
}