Socket
Book a DemoInstallSign in
Socket

@arifzyn/api

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arifzyn/api

Simple Wrapper From Arifzyn API.

2.0.3
latest
Source
npmnpm
Version published
Weekly downloads
21
250%
Maintainers
1
Weekly downloads
 
Created
Source

Arifzyn API Client

A TypeScript/JavaScript client for the Arifzyn API, providing a simple and intuitive way to interact with all Arifzyn API endpoints.

Installation

npm install @arifzyn/api

Quick Start

import { ArifzynAPI } from '@arifzyn/api';

// Initialize the client
const api = new ArifzynAPI({
  baseURL: 'https://api.arifzyn.site', // optional
  apiKey: 'YOUR_API_KEY', // optional
  timeout: 30000 // optional
});

// Make API calls
async function example() {
  const response = await api.get('ai/alicia', {
    text: 'Hello!'
  });
  console.log(response.result);
}

Features

  • Full TypeScript support
  • Support for all HTTP methods (GET, POST, PUT, DELETE)
  • Built-in endpoint filtering by category
  • Automatic error handling
  • Configurable base URL and API key
  • File upload support

Configuration

interface ArifzynConfig {
  baseURL?: string;    // API base URL (default: 'https://api.arifzyn.site')
  apiKey?: string;     // Your API key if required
  timeout?: number;    // Request timeout in milliseconds (default: 30000)
}

API Methods

Making Requests

// Using helper methods
await api.get(endpoint, params);
await api.post(endpoint, data);
await api.put(endpoint, data);
await api.delete(endpoint);

// Using generic call method
await api.call(endpoint, method, data);

Endpoint Management

// Get all available endpoints
const endpoints = await api.getEndpoints();

// Get endpoints by category
const aiEndpoints = await api.getEndpointsByCategory('ai');

// Get list of available categories
const categories = await api.getCategories();

Examples

Basic Usage

// GET request
const aliciaResponse = await api.get('ai/alicia', {
  text: 'Hello!'
});

// POST request
const postResponse = await api.post('some/endpoint', {
  data: 'value'
});

File Upload

const formData = new FormData();
formData.append('file', fileObject);

const uploadResponse = await api.post('upload/endpoint', formData);

Error Handling

try {
  const response = await api.get('some/endpoint');
} catch (error) {
  console.error('API Error:', error.message);
}

Response Type

interface ApiResponse<T = any> {
  creator: string;
  status: number;
  result: T;
}

Endpoint Type

interface Endpoint {
  category: string;
  base_code: string;
  name: string;
  path: string;
  example: Record<string, string>;
  parameters: string[];
  method: string;
  uri: string;
  files: boolean;
  error: boolean;
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Credits

Created by @arifzyn.site

Support

For support, please open an issue on the GitHub repository or contact the maintainers.

Keywords

arifzyn

FAQs

Package last updated on 05 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.